|
| 1 | +name: Fetch Meetups |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: "0 0 * * *" # Runs every day at 00:00 UTC time |
| 7 | + |
| 8 | +permissions: |
| 9 | + pull-requests: write |
| 10 | + contents: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + fetch: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - name: Set up Ruby |
| 18 | + |
| 19 | + uses: ruby/setup-ruby@v1 |
| 20 | + with: |
| 21 | + bundler-cache: true |
| 22 | + |
| 23 | + - name: Check for new Meetups |
| 24 | + run: bundle exec rake fetch_meetups |
| 25 | + |
| 26 | + - name: Verify Meetups Data |
| 27 | + run: bundle exec rake verify_meetups |
| 28 | + |
| 29 | + - name: Set up the formatted date and branch name |
| 30 | + run: | |
| 31 | + echo "FORMATTED_DATE=$(date +'%B %d, %Y')" >> $GITHUB_ENV |
| 32 | + echo "BRANCH_TO_MERGE=new-meetups-$(date +'%Y-%m-%d')" >> $GITHUB_ENV |
| 33 | +
|
| 34 | + - name: Commit New Meetups |
| 35 | + uses: stefanzweifel/git-auto-commit-action@v5 |
| 36 | + with: |
| 37 | + # Optional. Commit message for the created commit. |
| 38 | + # Defaults to "Apply automatic changes" |
| 39 | + commit_message: New Meetups on ${{ env.FORMATTED_DATE }} |
| 40 | + |
| 41 | + # Optional. Local and remote branch name where commit is going to be pushed |
| 42 | + # to. Defaults to the current branch. |
| 43 | + # You might need to set `create_branch: true` if the branch does not exist. |
| 44 | + branch: ${{ env.BRANCH_TO_MERGE }} |
| 45 | + |
| 46 | + # Optional. Options used by `git-commit`. |
| 47 | + # See https://git-scm.com/docs/git-commit#_options |
| 48 | + # commit_options: '--no-verify --signoff' |
| 49 | + |
| 50 | + # Optional glob pattern of files which should be added to the commit |
| 51 | + # Defaults to all (.) |
| 52 | + # See the `pathspec`-documentation for git |
| 53 | + # - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203 |
| 54 | + # - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec |
| 55 | + file_pattern: '_data/*.yml' |
| 56 | + |
| 57 | + # Optional. Local file path to the repository. |
| 58 | + # Defaults to the root of the repository. |
| 59 | + # repository: . |
| 60 | + |
| 61 | + # Optional commit user and author settings |
| 62 | + # commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]" |
| 63 | + # commit_user_email: my-github-actions-bot@example.org # defaults to "41898282+github-actions[bot]@users.noreply.github.com" |
| 64 | + # commit_author: Author <actions@github.com> # defaults to "username <username@users.noreply.github.com>", where "username" belongs to the author of the commit that triggered the run |
| 65 | + |
| 66 | + # Optional. Tag name being created in the local repository and |
| 67 | + # pushed to remote repository and defined branch. |
| 68 | + # tagging_message: 'v1.0.0' |
| 69 | + |
| 70 | + # Optional. Option used by `git-status` to determine if the repository is |
| 71 | + # dirty. See https://git-scm.com/docs/git-status#_options |
| 72 | + status_options: '--untracked-files=no' |
| 73 | + |
| 74 | + # Optional. Options used by `git-add`. |
| 75 | + # See https://git-scm.com/docs/git-add#_options |
| 76 | + # add_options: '-u' |
| 77 | + |
| 78 | + # Optional. Options used by `git-push`. |
| 79 | + # See https://git-scm.com/docs/git-push#_options |
| 80 | + # push_options: '--force' |
| 81 | + |
| 82 | + # Optional. Disable dirty check and always try to create a commit and push |
| 83 | + # skip_dirty_check: true |
| 84 | + |
| 85 | + # Optional. Skip internal call to `git fetch` |
| 86 | + # skip_fetch: true |
| 87 | + |
| 88 | + # Optional. Skip internal call to `git checkout` |
| 89 | + # skip_checkout: true |
| 90 | + |
| 91 | + # Optional. Prevents the shell from expanding filenames. |
| 92 | + # Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html |
| 93 | + # disable_globbing: true |
| 94 | + |
| 95 | + # Optional. Create given branch name in local and remote repository. |
| 96 | + create_branch: true |
| 97 | + |
| 98 | + - name: Create Pull Request |
| 99 | + run: gh pr create -B main -H ${{ env.BRANCH_TO_MERGE }} --title "New Meetups on ${{ env.FORMATTED_DATE }}" --body "Newly added Meetups on ${{ env.FORMATTED_DATE }}." |
0 commit comments