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

Change push CI to run on workflow_run event #17692

Merged
merged 1 commit into from Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 4 additions & 12 deletions .github/workflows/self-push-caller.yml
@@ -1,3 +1,4 @@
# Used to trigger self-push CI
name: Self-hosted runner (push-caller)

on:
Expand All @@ -13,17 +14,8 @@ on:

jobs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't comment above, bu I think we need a workflow_dispatch: under the on: above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow_dispatch is used to trigger a workflow manually:

To manually trigger a workflow, use the workflow_dispatch event. You can manually trigger a workflow run using the GitHub API, GitHub CLI, or GitHub browser interface.
(doc)

And this is not in our original push-CI workflow file. I checked the current logic in my own dummy repo., and things work as expected (of course, without the huge chunk of test jobs in transformers.)

Let me know if you have other considerations for adding workflow_dispatch, thanks.

run_push_ci:
name: Run Push CI
name: Trigger Push CI
runs-on: ubuntu-latest
steps:
- name: Checkout transformers
uses: actions/checkout@v2
with:
fetch-depth: 2
ssh-key: "${{ secrets.COMMIT_KEY }}"

- name: Checkout to branch push-ci
# A more strict way to make sure`push-ci` is exactly the same as `main` at the push event commit.
run: |
git checkout -b push-ci
git push -u origin push-ci --force
- name: Trigger push CI via workflow_run
run: echo "Trigger push CI via workflow_run"
5 changes: 4 additions & 1 deletion .github/workflows/self-push.yml
@@ -1,9 +1,12 @@
name: Self-hosted runner (push)

on:
workflow_run:
workflows: ["Self-hosted runner (push-caller)"]
branches: ["main"]
types: [completed]
push:
branches:
- push-ci
- ci_*
- ci-*
paths:
Expand Down