Skip to content

Commit

Permalink
use Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
T0biii committed Nov 3, 2024
1 parent b311eb7 commit 8b1dc6c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/update-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,21 @@ jobs:
update-Modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Clone Firmware
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Get Github App Token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Get update branch name
id: branch-name
Expand All @@ -36,6 +50,7 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7.0.1
with:
token: ${{ steps.app-token.outputs.token }}
title: '[${{ github.ref_name }}] Add targets ${{ steps.new-targets.outputs.names }}'
body: |
Updated targets for branch ${{ github.ref_name }}
Expand All @@ -44,6 +59,7 @@ jobs:
⚠️ Please trigger the CI before merging this pull request. ⚠️
commit-message: "targets: add ${{ steps.new-targets.outputs.names }}"
committer: ${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>
branch: ${{ steps.branch-name.outputs.branch-name }}
labels: ${{ github.ref_name }}
draft: true # this step does not trigger a CI run, so always mark them as draft
Expand Down

0 comments on commit 8b1dc6c

Please sign in to comment.