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

Remove PR trigger from template GH action workflow #4

Open
kbjarkefur opened this issue Aug 9, 2023 · 2 comments · Fixed by #13
Open

Remove PR trigger from template GH action workflow #4

kbjarkefur opened this issue Aug 9, 2023 · 2 comments · Fixed by #13
Labels
gha 🤖 GitHub Action solved but not yet published This issue is resolved, but not published on SSC yet, nor merged to main

Comments

@kbjarkefur
Copy link
Collaborator

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

I suggest changing this to:

 on: 
   push: 
     branches: [main, master] 

A merge of a PR is considered a push. So the action will be triggered when a PR is merged to main/master.

Otherwise the action will be triggered when a PR towards main/master is opened, and when a branch with an open PR towards main/master is updated. While technically not an issue, it is redundant, as in those cases nothing has changed on main/master where the action reads to, so it will never lead to any changes on the gh-pages branch. Since GH actions are free on public repos, this is not an issue in most cases, but if, for example, the build fails, you will get an error notification each time you update an open PR.

So all-in-all, I would say it is cleaner to not have a trigger for PRs. What do you think @arthur-shaw ?

@kbjarkefur
Copy link
Collaborator Author

If we agree to remove this, then I guess we should also remove this line:

if: github.event_name != 'pull_request'

@kbjarkefur
Copy link
Collaborator Author

Done in f77d898

Note the file was also renamed in that commit.

Leaving this issue open until our team has decided that this is what we will do.

@arthur-shaw arthur-shaw added the gha 🤖 GitHub Action label Jan 10, 2024
@kbjarkefur kbjarkefur added the solved but not yet published This issue is resolved, but not published on SSC yet, nor merged to main label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gha 🤖 GitHub Action solved but not yet published This issue is resolved, but not published on SSC yet, nor merged to main
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants