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

GHA Updates #186

Merged
merged 4 commits into from
Jul 9, 2024
Merged

GHA Updates #186

merged 4 commits into from
Jul 9, 2024

Conversation

lishaduck
Copy link
Contributor

@lishaduck lishaduck commented Jul 3, 2024

Improving security, etc.

Related: #173

@lishaduck lishaduck marked this pull request as ready for review July 4, 2024 00:54
Comment on lines +70 to +72
permissions:
contents: write

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I read through the dillonkearns/elm-publish-action source code, and I think this is all it needs.

Copy link
Owner

Choose a reason for hiding this comment

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

Alright. Next time I try to publish a package I'll try to backport this change there and test it out.

@lishaduck
Copy link
Contributor Author

This doesn't resolve all of #173, but the other updates were more involved, while this is self-contained (and I'm on vacation).

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Copy link
Owner

@jfmengels jfmengels Jul 7, 2024

Choose a reason for hiding this comment

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

Is @4 not enough? Do you think it risks breaking in the future? We could also miss on some security patches.

Some of these files will also be generated for new packages, and I don't imagine the users will want to update/upgrade the versions specified here all that often.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess for generated files, it might be reasonable not to pin them, but for us, it's more secure not to.
Pinning to a commit means that a malicious actor can't change the tag, as a commit is immutable, but not a tag. GitHub also doesn't have the greatest track record with both bugs and SemVer, and has happily broken the latest versions of actions for weeks at a time.
Dependabot should bump them, so missing patches shouldn't be a major issue.

I explained this a few weeks ago in a similar PR, so if my wording doesn't make sense (I personally doubt I said this in a way that makes sense), try this explanation instead: material-extensions/vscode-material-icon-theme#2365 (comment).

Copy link
Owner

@jfmengels jfmengels Jul 9, 2024

Choose a reason for hiding this comment

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

What do you think about (in a followup PR) adding pinning these versions in this file and in new-package generated files, and adding a comment to explain the reason and how to upgrade (how/where to find the new commit for instance). I think that way both this project and users of the package benefit from the improvements here.

Copy link
Contributor Author

@lishaduck lishaduck Jul 9, 2024

Choose a reason for hiding this comment

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

They're already pinned. Are you proposing to add a comment about why they're pinned?
EDIT: If so, we could just add a dependabot config in the github dir by default.

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, a comment on how they're pinned, and how to upgrade to a new version. Right now I could ask you, but one day you might not (and new-package users probably won't either 😅 ).

I'm still on the fence for dependendabot. Honestly, it's not that useful for Elm packages, it would just create a bunch of noise for package auhors. I think it makes sense for this project (although I'm still trying to figure out whether it's too much noise or not).

Copy link
Contributor Author

@lishaduck lishaduck Jul 9, 2024

Choose a reason for hiding this comment

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

Yeah. That was a lot more noise than I'd expected.
With elm packages though, it should just notify that there're new majors.

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah. That was a lot more noise than I'd expected.

Same here 😅
The GitHub rate limit has exploded 😂

With elm packages though, it should just notify that there're new majors.

Hmm, I don't even know if it should. For a package author, as long as they can run tools and tests (locally and in CI) and publish (through CI), they don't need to have the latest version of anything 🤷‍♂️

Copy link
Contributor Author

@lishaduck lishaduck Jul 9, 2024

Choose a reason for hiding this comment

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

Yeah, but it would block the application from upgrading other review rules.
Say elm-review-simplify needs elm-review 2 or 3, but only declares support for 2, and elm-review-unused needs elm-review 3, then one couldn't get the improvements to elm-review-unused.

(Probably some other package than elm-review, but I think my point is clear enough as is?)

Copy link
Contributor Author

@lishaduck lishaduck Jul 9, 2024

Choose a reason for hiding this comment

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

Another thing, I think I forgot to set it to weekly, I usually have it set to daily, but weekly is a lot more manageable in my experience.

EDIT: I did set it to daily.

@jfmengels
Copy link
Owner

jfmengels commented Jul 9, 2024

Thank you!

@jfmengels jfmengels merged commit 6c1e25b into jfmengels:main Jul 9, 2024
1 check passed
@lishaduck lishaduck deleted the gha branch July 9, 2024 15:51
This was referenced Aug 8, 2024
lishaduck added a commit to lishaduck/node-elm-review that referenced this pull request Nov 10, 2024
Way back a long time ago in jfmengels#186 (comment), @jfmengels asked me to write some comments.

I also updated the workflows to align with recent changes to our test workflow in jfmengels#288.
@lishaduck lishaduck mentioned this pull request Nov 10, 2024
lishaduck added a commit to lishaduck/node-elm-review that referenced this pull request Nov 10, 2024
Way back a long time ago in jfmengels#186 (comment), @jfmengels asked me to write some comments.

I also updated the workflows to align with recent changes to our test workflow in jfmengels#288.
lishaduck added a commit to lishaduck/node-elm-review that referenced this pull request Nov 10, 2024
Way back a long time ago in jfmengels#186 (comment), @jfmengels asked me to write some comments.

I also updated the workflows to align with recent changes to our test workflow in jfmengels#288.
jfmengels pushed a commit that referenced this pull request Nov 10, 2024
Way back a long time ago in #186 (comment), @jfmengels asked me to write some comments.

I also updated the workflows to align with recent changes to our test workflow in #288.
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

Successfully merging this pull request may close these issues.

2 participants