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
PR created but action not started #187
Comments
I have another repo with the same problem: |
Same here! Qiskit/web-components#83 |
Same here! Milkdown/milkdown#531 |
Hey guys |
same issue in my private repo |
@yishayweb you can turf all that custom code to test if changesets exist and use either:
or you can just use the https://github.com/changesets/changesets/tree/main/packages/cli#status |
From GitHub docs:
So the solution could be this: env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
Yes, @kachkaev's answer is the correct one. Would you be so kind to add a note about this in the README of this action? |
I’m still a bit confused by these tokens actually. After setting a custom GitHub token in blockprotocol/blockprotocol#510, I saw a new PR authored by the corresponding user and CI ran fine. However, after mere PRs got merged into First Commit Actions (full set): Actions for one of subsequent force-pushes (no checks for Merging is blocked: Seems like the custom Any tips anyone? |
I tried configuring custom git credentials in https://github.com/blockprotocol/blockprotocol/pull/535/files env:
+ GIT_AUTHOR_EMAIL: custom-value@example.com
+ GIT_AUTHOR_NAME: Custom Value
+ GIT_COMMITTER_EMAIL: custom-value@example.com
+ GIT_COMMITTER_NAME: Custom Value
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} However, this did not help. Here is what I see in the ‘Version Packages’ PR: Commit metadata matches new environment variables that I’ve set:
The push though is still done by github-actions[bot] so checks are not triggered. 🤔 Because Linting is a required check, the PR cannot be merged unless a developer force-pushes to the branch just before releasing new versions. |
This is surprising to me and, unfortunately, I don't know the answer to this problem. Perhaps it would be worth opening a ticket with GitHub support to learn what are the exact requirements for workflows to be executed. However, if I take a look at this commit and the related PR then I can see that workflows were correctly executed for both. So perhaps this is an issue in your setup. As far as I can see they only provide a custom token and nothing more: |
Thanks for sharing a link to developit/microbundle#958 @Andarist! If we look at individual commits in this PR, we can see the same pattern as in blockprotocol/blockprotocol#529. The first commit has ✅, but all the following force-pushed ones lack CI checks (1, 2, 3, ...). All commits are authored by github-actions[bot] despite The PR is then closed and reopened, which seems to work as a trigger for GitHub Actions. CI runs for the latest github-actions[bot]’s commit but is marked as triggered by a human. I tried closing and re-opening blockprotocol/blockprotocol#529 too and this did trigger GitHub Actions. That’s a bit hacky but I don’t see any alternatives at this point. Unless I miss something, redefining |
This is bizarre... 🙈 it would really be lovely if we could create a GitHub support ticket about this. Would you be willing to do this? You already have all the required context to explain the issue properly |
I think I figured it out. Here is my final solution: jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'org/repo'
steps:
- uses: actions/checkout@v3
+ with:
+ token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- uses: ./.github/actions/warm-up-repo
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1.3.0
with:
publish: yarn changeset publish
env:
+ GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} When the action calls Resulting PR: blockprotocol/blockprotocol#542 CI runs for each new commit: Now that I know that closing and reopening a PR replaces |
Yeah, in theory, you could craft a more complex pipeline that would wait for the CI checks on your base branch before updating the versioning PR and skip jobs there because they would be somewhat redundant if you have already run jobs on the base branch. It would be great to block the ability to merge the versioning PR when there is a pending CI job on the base branch too. Would you be willing to add all of this information to the README, with the tradeoffs mentioned there? |
I can try next week, but feel free to do this earlier if you want! A change in README should close this issue I guess. |
Possibly, yes. Here is another idea, which may work together with yours. Before force-pushing, the action can:
‘Version Packages’ will be out of date with |
Github just shipped https://github.blog/changelog/2022-09-08-github-actions-use-github_token-with-workflow_dispatch-and-repository_dispatch/ Perhaps there could be a mechanism where users specify a set of actions that need to be triggered on the Version Packages PR using workflow_dispatch after it is created/updated. It seems like that'd allow CI runs to occur without needing custom tokens. Something like:
|
If you could prototype this - it would be kinda cool. |
* ci(changesets): version packages * ci(release): set custom PAT (changesets/action#187) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Brian Cooper <brian@brian-cooper.com>
Another option is to allow the setting to create Draft PR(there is already a PR, but I'm not sure why it doesn't merge, maybe the person who created this PR is retired), so that when an actual person made [Ready for Review], then workflow will run |
You can see that the PR is opened correctly: clibuilder/clibuilder#375
But there is no workflow started: https://github.com/unional/clibuilder/actions
I'm setting it up using shared workflow:
https://github.com/unional/clibuilder/blob/main/.github/workflows/release.yml
https://github.com/unional/.github/blob/main/.github/workflows/yarn2-library-release.yml
Maybe somehow the action is getting wrong information because of that?
The text was updated successfully, but these errors were encountered: