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 workflow to automatically build for npm changes #209

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

lucacome
Copy link
Contributor

@lucacome lucacome commented Jan 18, 2023

Adds workflow to automatically build for npm changes

@lucacome lucacome force-pushed the add-dependabot branch 2 times, most recently from c8665c2 to 23fce7b Compare January 19, 2023 02:03
@lucacome
Copy link
Contributor Author

lucacome commented Feb 1, 2023

@kzantow any ideas why the checks failed? Would it be possible to re-run them?

@kzantow kzantow closed this Feb 1, 2023
@kzantow kzantow reopened this Feb 1, 2023
@kzantow
Copy link
Contributor

kzantow commented Feb 1, 2023

There is a bit of a problem enabling dependabot on this repository: the dist/index.js needs to be regenerated for any dependencies which have code included in it (needs an npm install and npm run build, basically), but there is no way to cause this to happen with dependabot PRs that I'm aware of. Do you have any suggestions how to cause this to happen?

@lucacome
Copy link
Contributor Author

lucacome commented Feb 2, 2023

We can do it with a GitHub action using https://github.com/dependabot/fetch-metadata
I can create a workflow and add it to this PR if you think that would work.

@kzantow
Copy link
Contributor

kzantow commented Mar 4, 2023

Hi @lucacome if you feel like adding a workflow for this, that would be great!

It basically just needs to run npm run build and add the changes in the dist/ folder to the dependabot PR.

@lucacome
Copy link
Contributor Author

@kzantow finally got around to adding the workflow.
You need to add a PAT for the workflow to work (I called it COMMIT_PAT) in https://github.com/anchore/scan-action/settings/secrets/dependabot for dependabot.
It's possible to commit without a PAT but it will not re-trigger the workflow after the commit.

@kzantow
Copy link
Contributor

kzantow commented Dec 20, 2023

Trying to move this forward, we needed some dependabot PRs to test this workflow with, so we went ahead and enabled dependabot in this PR and will revisit this PR to enable automatic update of dist/js files and auto merging of passing dependency updates.

@kzantow kzantow self-assigned this Dec 20, 2023
@lucacome lucacome changed the title Add dependabot config Add workflow to automatically build for npm changes Dec 20, 2023
@lucacome
Copy link
Contributor Author

Thanks @kzantow I've rebased the PR

@kzantow kzantow removed their assignment May 24, 2024
@spiffcs spiffcs merged commit c2b2a29 into anchore:main Oct 3, 2024
32 checks passed
@lucacome lucacome deleted the add-dependabot branch October 3, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants