Skip to content

fix: permission input handling #243

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

Merged
merged 11 commits into from
May 2, 2025
Merged

fix: permission input handling #243

merged 11 commits into from
May 2, 2025

Conversation

parkerbxyz
Copy link
Contributor

@parkerbxyz parkerbxyz commented May 2, 2025

This pull request fixes the handling of permissions inputs.

  • Updated getPermissionsFromInputs in lib/get-permissions-from-inputs.js to use hyphens (INPUT_PERMISSION-) instead of underscores (INPUT_PERMISSION_) in input keys, added a check to skip empty values, and clarified behavior when no permissions are set.
  • Added a shouldRetry function to retry requests when server errors (HTTP status 500 or higher) occur in the main function in lib/main.js to prevent unnecessary retries.
  • Updated test cases in tests/main-token-permissions-set.test.js to match the new input key format with hyphens.
  • Added a default empty string for unset inputs (e.g., INPUT_PERMISSION-ADMINISTRATION) in tests/main.js to simulate the behavior of the Actions runner.
  • Updated snapshots in tests/snapshots/index.js.md to reflect the updated hyphenated input keys in permissions.

@parkerbxyz parkerbxyz self-assigned this May 2, 2025
@parkerbxyz parkerbxyz changed the title Test permissions fix: permissions May 2, 2025
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

We paired on it, it's good from my side 👍🏼

@gr2m
Copy link
Contributor

gr2m commented May 2, 2025

@parkerbxyz make sure the PR closes #237 and comment on #236 and close the discussion

@parkerbxyz parkerbxyz changed the title fix: permissions fix: permission inputs handling May 2, 2025
@parkerbxyz parkerbxyz changed the title fix: permission inputs handling fix: permission input handling May 2, 2025
@parkerbxyz parkerbxyz marked this pull request as ready for review May 2, 2025 18:35
@parkerbxyz parkerbxyz requested a review from a team as a code owner May 2, 2025 18:35
@parkerbxyz parkerbxyz merged commit 2950cbc into main May 2, 2025
5 checks passed
@parkerbxyz parkerbxyz deleted the new-integration-test branch May 2, 2025 18:44
create-app-token-action-releaser bot pushed a commit that referenced this pull request May 2, 2025
## [2.0.4](v2.0.3...v2.0.4) (2025-05-02)

### Bug Fixes

* permission input handling ([#243](#243)) ([2950cbc](2950cbc))
@create-app-token-action-releaser

🎉 This PR is included in version 2.0.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

Using permission-* option with actions/create-github-app-token does not restrict token permissions
2 participants