detect new releases #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: detect new releases | |
on: | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
type: boolean | |
description: Run the workflow without creating a pull request | |
required: false | |
default: false | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
detect-new-releases: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1 | |
with: | |
bun-version: latest | |
- name: install dependencies | |
run: bun install | |
- name: check latest release | |
run: bun run check:release | |
- name: detect changes for `emojis.lock` | |
id: has-lock-changes | |
run: | | |
# set has-lock-changes to true if emojis.lock has changes | |
if git diff --exit-code emojis.lock; then | |
echo "no changes detected in emojis.lock" | |
echo "has-lock-changes=false" >> $GITHUB_OUTPUT | |
else | |
echo "changes detected in emojis.lock" | |
echo "has-lock-changes=true" >> $GITHUB_OUTPUT | |
fi | |
- name: create pull request | |
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 | |
if: ${{ github.event.inputs.dry-run != 'true' && steps.has-lock-changes.outputs.has-lock-changes == 'true' }} | |
with: | |
commit-message: "feat: new emoji release" | |
title: "feat: new emoji release" | |
body: | | |
I found a new emoji release 🎉. | |
I don't know what they changed, but I'm sure it's awesome 🤖. | |
> [!IMPORTANT] | |
> When you merge this PR, i will trigger a action to build the new emoji release. | |
I will be waiting for your approval 👋. | |
This is an automated PR to update the emoji releases. | |
branch: new-emoji-release | |
add-paths: emojis.lock | |
base: main | |
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
reviewers: luxass | |