-
Notifications
You must be signed in to change notification settings - Fork 11
81 lines (69 loc) · 2.51 KB
/
update-github-config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Update shared github-config
on:
schedule:
- cron: '30 1 * * *'
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.PAKETO_BOT_GITHUB_TOKEN }}
- name: Checkout github-config
uses: actions/checkout@v3
with:
repository: paketo-buildpacks/github-config
path: github-config
- name: Checkout Branch
uses: paketo-buildpacks/github-config/actions/pull-request/checkout-branch@main
with:
branch: automation/github-config/update
- name: Run the sync action
uses: paketo-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: paketo-buildpacks/github-config/actions/pull-request/create-commit@main
with:
message: "Updating github-config"
pathspec: "."
keyid: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY_ID }}
key: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY }}
- name: Push Branch
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: paketo-buildpacks/github-config/actions/pull-request/push-branch@main
with:
branch: automation/github-config/update
- name: Open Pull Request
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: paketo-buildpacks/github-config/actions/pull-request/open@main
with:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
title: "Updates github-config"
branch: automation/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: paketo-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}}