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

Add build & diff "/dist" folder workflow #706

Closed
jaffrepaul opened this issue Jan 5, 2023 · 6 comments
Closed

Add build & diff "/dist" folder workflow #706

jaffrepaul opened this issue Jan 5, 2023 · 6 comments

Comments

@jaffrepaul
Copy link
Member

Add workflow to build & diff /dist folder on PR merges to avoid not triggering a build when this step is missing

@MikeMcC399
Copy link
Collaborator

@jaffrepaul

It would be a good improvement to add this.

I have a few other suggestions for restructuring main.yml when you get to this point, like removing the redundant build with multiple node versions and taking the markdown-link-check out of the release flow.

@MikeMcC399
Copy link
Collaborator

@jaffrepaul

Possibly this should be implemented together with branch protection rules. I don't have visibility into the rules, since I'm only a Contributor, but it seems that they are currently quite lax.

@jaffrepaul
Copy link
Member Author

current master branch rules dictate:

  • branches must be up to date
  • a PR & approval is required to merge
  • status checks must pass

@MikeMcC399
Copy link
Collaborator

I based a new workflow on the workflow: check-dist.yml from the GitHub repo actions/javascript-action as suggested by @jaffrepaul. Create a JavaScript Action is provided as a template by GitHub to "bootstrap the creation of a JavaScript action".

I did not use the upload artifact part because I did not find it helpful. In the case of an error the Action log already shows the git diff output, which should be enough to be able to rectify the discrepancy. I also didn't use the paths-ignore: parameters, since it did not cover all cases and it would have been overly complicated to add them all. This means that the workflow may run when it is not strictly necessary, however the overhead is small and it makes the workflow easier to understand.

When the PR is merged it will signal to PR submitters that their PR is incomplete if they have changed index.js without rebuilding the action.

The workflow will also signal a problem if bots such as renovate update dependencies embedded in /dist/index.js which would also require a rebuild.

@MikeMcC399
Copy link
Collaborator

@jaffrepaul

@jaffrepaul
Copy link
Member Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants