Update shared github-config #39
This file contains 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: Update shared github-config | |
on: | |
schedule: | |
- cron: '27 13 * * *' # daily at 13:27 UTC | |
workflow_dispatch: {} | |
concurrency: github_config_update | |
jobs: | |
build: | |
name: Create PR to update shared files | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Checkout github-config | |
uses: actions/checkout@v3 | |
with: | |
repository: initializ-buildpacks/github-config | |
path: github-config | |
- name: Checkout Branch | |
uses: initializ-buildpacks/github-config/actions/pull-request/checkout-branch@main | |
with: | |
branch: automations/github-config/update | |
- name: Run the sync action | |
uses: initializ-buildpacks/github-config/actions/sync@main | |
with: | |
workspace: /github/workspace | |
config: /github/workspace/github-config/implementation | |
- name: Cleanup | |
run: rm -rf github-config | |
- name: Commit | |
id: commit | |
uses: initializ-buildpacks/github-config/actions/pull-request/create-commit@main | |
with: | |
message: "Updating github-config" | |
pathspec: "." | |
keyid: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY_ID }} | |
key: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY }} | |
- name: Push Branch | |
if: ${{ steps.commit.outputs.commit_sha != '' }} | |
uses: initializ-buildpacks/github-config/actions/pull-request/push-branch@main | |
with: | |
branch: automations/github-config/update | |
- name: Open Pull Request | |
if: ${{ steps.commit.outputs.commit_sha != '' }} | |
uses: initializ-buildpacks/github-config/actions/pull-request/open@main | |
with: | |
token: ${{ secrets.PAT }} | |
title: "Updates github-config" | |
branch: automations/github-config/update | |
failure: | |
name: Alert on Failure | |
runs-on: ubuntu-22.04 | |
needs: [build] | |
if: ${{ always() && needs.build.result == 'failure' }} | |
steps: | |
- name: File Failure Alert Issue | |
uses: initializ-buildpacks/github-config/actions/issue/file@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repo: ${{ github.repository }} | |
label: "failure:update-github-config" | |
comment_if_exists: true | |
issue_title: "Failure: Update GitHub config workflow" | |
issue_body: | | |
Update GitHub config workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). | |
comment_body: | | |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |