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

support: can an application token be used to deploy? #1054

Closed
3 tasks done
btrautmann opened this issue Jan 16, 2024 · 4 comments
Closed
3 tasks done

support: can an application token be used to deploy? #1054

btrautmann opened this issue Jan 16, 2024 · 4 comments
Assignees
Labels

Comments

@btrautmann
Copy link

Checklist

  • I am using the latest version of this action.
  • I have read the latest README and followed the instructions.
  • I have read the latest GitHub Actions official documentation and learned the basic spec and concepts.

Describe your question

The README clearly outlines the ability to use GITHUB_TOKEN, a deploy key, or SSH key for deploying. I'm wondering if I could use a short-lived application token (installed/configured for the repo) to deploy? I've tried a few different approaches but none seem to work and I can't find any questions asking the same.

Relevant links

Our repository is private so can't be linked to.

Relevant log output

One of two errors happens depending on configuration:

  1. Action failed with "The process '/usr/bin/git' failed with exit code 1"
  2. Action failed with "The generated GITHUB_TOKEN (github_token) does not support to push to an external repository. Use deploy_key or personal_token."

Additional context.

We're using the following to get the app token:

      - name: Get application token
        id: get_token
        uses: getsentry/action-github-app-token@97c9e23528286821f97fba885c1b1123284b29cc #v2.0.0
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.PRIVATE_KEY }}
@btrautmann btrautmann added the support User support label Jan 16, 2024
@peaceiris
Copy link
Owner

Did you follow the next instruction?

https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-deploy-to-external-repository-external_repository

Note that GITHUB_TOKEN has no permission to access to external repositories. Please create a personal access token and set it to personal_token like personal_token: ${{ secrets.PERSONAL_TOKEN }}.

We need to pass our personal access token or GitHub App token to personal_token.

@btrautmann
Copy link
Author

Did you follow the next instruction?

https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-deploy-to-external-repository-external_repository

Note that GITHUB_TOKEN has no permission to access to external repositories. Please create a personal access token and set it to personal_token like personal_token: ${{ secrets.PERSONAL_TOKEN }}.

We need to pass our personal access token or GitHub App token to personal_token.

I did try passing it to personal_token but it didn't work. I'll try again and loop back here with an update. Thanks for responding!

@btrautmann
Copy link
Author

Ah, an internal tool is actually blocking the push, so it's on our end. It seems personal_token works as expected. Thanks!

Copy link
Contributor

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants