-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
move GITHUB_TOKEN to inputs #30
Comments
@yelizariev I've created a PR for this in #35. I've also tested this in my demo app here: However, I'm not really convinced why this is the better or what the upsides are. - uses: stefanzweifel/git-auto-commit-action@master
with:
commit_message: Apply php-cs-fixer changes
branch: ${{ github.head_ref }}
env:
GITHUB_TOKEN: my-random-token Other projects I've seen so far all use Could you elaborate the following point with some examples?
Or why this action should make checks on the token?
|
Potential use is for choosing default values for Author and Commiter
Currently, there is no check that github token is provided. It seems, though, that the GITHUB_TOKEN is always available in the environment. While on using the input, it's explicitly specified that argument is required. I think I tried something like in your example
But somehow it doesn't. Not sure, though. It could be just some author\commiter behaviour.
I actually got this idea from other github actions:
|
Ah I see. I think the structure in my example might be from the old beta. The official docs now also use a similar example like you mentioned: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#using-the-github_token-in-a-workflow name: Pull request labeler
on:
- pull_request
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }} With the release of actions/checkout@v2 we could also eliminate the whole token thing completely Example. v2 stores the credentials by default in the local git directory and allows subsequent Actions to push back to the repository. Would this change break your workflows? |
I will be able to set my custom token in checkout@v2 section. But I need to check whether issues from #28 are gone with checkout@v2 authentication. I'll test #36 in coming days |
@yelizariev Could you already test the changes in #36? The README in the PR/branch has been updated and my tests all worked fine. I would like to move on with this PR and merge this into |
Stefan, I apologize for delay. I actually switched to another deployment and don't use Github Pages for now. But I'm glad to assist you with the refactoring. ... So, I confirm that #36 closes #28 Config:
Logs: https://github.com/itpp-labs/odoo-test-docs/runs/427059846 Commit: itpp-labs/odoo-test-docs@f9c41ce The Deployment was triggered by the commit: https://github.com/itpp-labs/odoo-test-docs/deployments |
Thanks for the work! |
Alright. Gonna merge #36 now. |
Pros:
required: true
and other properties inaction.yml
and handle the argument on action level and not just in scriptsIt's implemented here https://github.com/stefanzweifel/git-auto-commit-action/pull/26/files, but that PR has other updates
The text was updated successfully, but these errors were encountered: