|
1 | | -name: Check and Create PR for Badges |
| 1 | +name: Check and Update Badges |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | schedule: |
|
9 | 9 | check-badges: |
10 | 10 | runs-on: ubuntu-22.04 |
11 | 11 |
|
12 | | - outputs: |
13 | | - branch_name: ${{ steps.set-branch-name.outputs.branch_name }} |
14 | | - |
15 | 12 | steps: |
16 | 13 | - name: Checkout repository |
17 | 14 | uses: actions/checkout@v3 |
@@ -64,50 +61,12 @@ jobs: |
64 | 61 | git config --local user.email "[email protected]" |
65 | 62 | BRANCH_NAME="update-badges-${{ github.run_id }}" |
66 | 63 | echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV |
67 | | - echo "$BRANCH_NAME" > branch-name.txt |
68 | 64 | git checkout -b $BRANCH_NAME |
69 | 65 | git commit -m "Update badges.json with latest release URLs" |
70 | 66 | git push origin HEAD |
71 | | - echo "::set-output name=branch_name::$BRANCH_NAME" |
72 | 67 | echo "::notice::Changes committed and branch pushed." |
73 | 68 |
|
74 | | - - name: Upload branch name artifact |
| 69 | + - name: Notify manual pull request needed |
75 | 70 | if: env.skip != 'true' |
76 | | - uses: actions/upload-artifact@v4 |
77 | | - with: |
78 | | - name: branch-name |
79 | | - path: branch-name.txt |
80 | | - |
81 | | - create-pr: |
82 | | - runs-on: ubuntu-22.04 |
83 | | - needs: check-badges |
84 | | - if: needs.check-badges.outputs.branch_name != '' |
85 | | - steps: |
86 | | - - name: Checkout repository |
87 | | - uses: actions/checkout@v3 |
88 | | - with: |
89 | | - fetch-depth: 0 |
90 | | - |
91 | | - - name: Download branch name artifact |
92 | | - uses: actions/download-artifact@v4 |
93 | | - with: |
94 | | - name: branch-name |
95 | | - |
96 | | - - name: Load branch name |
97 | 71 | run: | |
98 | | - BRANCH_NAME=$(cat branch-name.txt) |
99 | | - echo "Loaded branch name: $BRANCH_NAME" |
100 | | - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV |
101 | | -
|
102 | | - - name: Create Pull Request |
103 | | - uses: peter-evans/create-pull-request@v5 |
104 | | - with: |
105 | | - token: ${{ secrets.GITHUB_TOKEN }} |
106 | | - base: gh-pages |
107 | | - branch: ${{ env.BRANCH_NAME }} |
108 | | - title: "Update badges.json" |
109 | | - body: | |
110 | | - This pull request updates `badges.json` with the latest release URLs. |
111 | | - Please review and merge if everything looks correct. |
112 | | - labels: "automated update" |
113 | | - assignees: "Garlicrot" |
| 72 | + echo "A new branch '$BRANCH_NAME' was created. Please open a pull request manually." |
0 commit comments