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

How to correctly set token #41

Closed
yammyxing opened this issue Dec 29, 2019 · 4 comments
Closed

How to correctly set token #41

yammyxing opened this issue Dec 29, 2019 · 4 comments

Comments

@yammyxing
Copy link

I'd like to push to my another repo

My action looks like this below:

...
- name: Commit files
      working-directory: ./dist
      run: |
        git config --local user.email "action@github.com"
        git config --local user.name "GitHub Action"
        git commit -m "update blog" -a
    - name: Push changes as deploy
      uses: ad-m/github-push-action@master
      with:
        github_token: ${{ secrets.PUSH_SECRET_FOR_ACTION }}
        force: true
        repository: "me.github.io"

And my repo's secret looks like this which value is from Personal Access Token:
image

But finally Got this:
image

I've also read this related issue about How to set GITHUB_TOKEN

But I still failed. Is there sth I've been misunderstanding ? Hope to get an answer, thanks.

@ad-m
Copy link
Owner

ad-m commented Dec 29, 2019

Let's try following:

    - name: Push changes as deploy
      uses: ad-m/github-push-action@master
      with:
        github_token: ${{ secrets.push_secret_for_action }}
        force: true
        repository: "me.github.io"

@yammyxing
Copy link
Author

image
Did like what you said, still got this like above.

Is there sth wrong? Confused

@sorpdev
Copy link

sorpdev commented Dec 30, 2019

Did you add the secret in the repo in which you have the workflow?
(github.com/.../.../settings/secrets)

@yammyxing
Copy link
Author

Did you add the secret in the repo in which you have the workflow?
(github.com/.../.../settings/secrets)

thx. It works

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

3 participants