-
Notifications
You must be signed in to change notification settings - Fork 12
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Possible to automagically use ${{ github.token }} ? #17
Comments
That is pretty interesting, and honestly pretty surprising security wise. Without specified user input of a GitHub token, public repositories (from first glance) are at risk of write vulnerabilities from a third party library/action. Does the above code actually permit pushing without the GitHub action yml file specifying token? |
I think they were until the default got switched to read-only https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
This workflow works! name: Test
on:
push:
paths: [index.sh, action.yml, wiki/**, .github/workflows/test.yml]
concurrency: test
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./ I don't think that it would work if I created a new repo today since the default is Yeah so that repo has inherited the default read-write and I could change it if I wanted |
I think doing this implicitly is not great practice, so closing. Feel free to add more comments. |
To play advocate for the other side, I think that this: - uses: actions/checkout@v3 # doesn't need GH_TOKEN to pull from repo
- uses: Andrew-Chen-Wang/github-wiki-action # to conform with others, it'd be nice to have default pick it up
- uses: actions/deploy-pages@v1 # picks up token to deploy a website
- uses: stefanzweifel/git-auto-commit-action@v4 # literally pushes to the repo with one line, no token is preferable to the verbosity of this: - uses: actions/checkout@v3
with:
token: ${{ github.token }}
- uses: Andrew-Chen-Wang/github-wiki-action
with:
GH_TOKEN: ${{ github.token }}
- uses: actions/deploy-pages@v1
with:
token: ${{ github.token }}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
token: ${{ github.token }} note that you STILL NEED TO DECLARE PERMISSIONS to give that token access to writing the pages, repo, issues, whatever: https://github.com/actions/deploy-pages # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source |
Will look into it. I think actually having tests with the CI would help and also having a test on private repos would be great too |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Currently:
github-wiki-action/action.yml
Lines 10 to 16 in 7f44b14
But, I think you can make it magic so you don't need to specify the GH_TOKEN variable:
I don't know 100% for sure, but I think this is possible. I think it's at least worth investigating though.
Here's what I know does work: https://github.com/jcbhmr/publish-wiki-action/blob/a9cd93ca56fd5ed2bf562abc26af3771fb8e63bd/action.yml
The text was updated successfully, but these errors were encountered: