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

Adds actionlint to lint GitHub Actions workflows #4326

Merged
merged 5 commits into from
Oct 15, 2024
Merged

Conversation

JayShortway
Copy link
Member

Since we have a relatively complex GitHub Actions workflow, I figured it makes sense to add a linter to automatically catch errors. I've been using the online variant of this linter any time some workflow isn't working: https://rhysd.github.io/actionlint/. The same was recently merged to purchases-kmp: RevenueCat/purchases-kmp#227.

@JayShortway JayShortway requested a review from a team September 30, 2024 11:54
@JayShortway JayShortway self-assigned this Sep 30, 2024
@JayShortway
Copy link
Member Author

Back to draft, because repository rules restrict usage of actionlint.

@JayShortway JayShortway marked this pull request as draft September 30, 2024 11:56
@JayShortway
Copy link
Member Author

This is ready for review. If it's approved, I'll update the repository settings to allow actionlint (and GHA's checkout action). If you disagree, we can close this. No biggie.

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

LGTM!

@JayShortway JayShortway marked this pull request as ready for review October 15, 2024 12:43
@JayShortway
Copy link
Member Author

@tonidero @aboedo Had to make these changes to trigger_all_tests.yml to make the linter happy:

-        run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')
+        run: echo "branch=$(gh pr view "$PR_NO" --repo "$REPO" --json headRefName --jq '.headRefName')" >> "$GITHUB_OUTPUT"
  1. Not using the deprecated ::set-output (docs).
  2. Double quoting variables ($PR_NO & $REPO) to prevent globbing and word splitting.

Please have a looksie.

@JayShortway JayShortway merged commit b3a600e into main Oct 15, 2024
6 checks passed
@JayShortway JayShortway deleted the actionlint branch October 15, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants