Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token created with actions/create-github-app-token fails but tibdex version works. #187

Open
smason-apex opened this issue Nov 23, 2024 · 0 comments

Comments

@smason-apex
Copy link

I'm trying to switch from tibdex/github-app-token@v1 to actions/create-github-app-token@v1 and a token created for a github app fails to check out a repository after the change.

I created a workflow that demonstrates the problem. You'll need to update the app as well as the repo checked out. Checkout tibdex succeeds whereas Checkout gha fails.

Can't tell what the difference is in the tokens.

name: wtf
on:
  push:
    branches-ignore:
      - main
      - develop
concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

jobs:
  token-madness:
    runs-on: ubuntu-latest

    env:
      APP_ID: ${{ vars.MY_APP_APP_ID }}
      PEM: ${{ secrets.MY_APP_APP_PEM }}

    steps:
      - name: Generate tibdex token
        id: tibdex
        uses: tibdex/github-app-token@v1
        with:
          app_id: ${{ env.APP_ID }}
          private_key: ${{ env.PEM }}

      - name: Generate actions token
        id: gha
        uses: actions/create-github-app-token@v1
        with:
          app-id: ${{ env.APP_ID }}
          private-key: ${{ env.PEM }}

      - name: who am i gha?
        run: gh auth status
        env:
          GH_TOKEN: ${{ steps.gha.outputs.token }}

      - name: who am i tibdex?
        run: gh auth status
        env:
          GH_TOKEN: ${{ steps.tibdex.outputs.token }}

      - name: Checkout gha
        uses: actions/checkout@v4
        with:
          repository: testing/foobar
          token: ${{ steps.gha.outputs.token }}

      - name: Checkout tibdex
        uses: actions/checkout@v4
        with:
          repository: testing/foobar
          token: ${{ steps.tibdex.outputs.token }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant