Skip to content

Commit

Permalink
Update rust-ci.yml (#35)
Browse files Browse the repository at this point in the history
Key Changes:

Generate GitHub App Token:

Uses tibdex/github-app-token@v1 to generate an installation token.
Inputs:
app_id: The App ID stored in your repository variables.
private_key: The private key stored in your repository secrets.
Outputs: The action outputs a token that you can use for authentication.
Checkout Code with Token:

In actions/checkout@v3, set the token input to ${{ steps.generate_token.outputs.token }}.
Use Token in Other Actions:

For any actions that require authentication (e.g., peter-evans/create-pull-request@v4), use the generated token:
token: ${{ steps.generate_token.outputs.token }}
  • Loading branch information
ERLindeman authored Sep 13, 2024
1 parent 9aa448b commit 199200f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ jobs:
permissions:
contents: write
pull-requests: write
checks: write # Needed for waiting on status checks
statuses: write
issues: write
actions: write

steps:
- uses: actions/checkout@v3
- name: Generate GitHub App Token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ vars.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}

- name: Install Rust stable
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -60,7 +69,7 @@ jobs:
if: steps.changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.generate_token.outputs.token }}
commit-message: "Apply rustfmt formatting"
branch: formatting-fixes
title: "Automated Formatting Fixes"
Expand Down

0 comments on commit 199200f

Please sign in to comment.