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

Update and fix our ChatOps automations to only run on pull request comments #3034

Merged
merged 8 commits into from
Oct 22, 2023

Conversation

echoix
Copy link
Collaborator

@echoix echoix commented Oct 21, 2023

Our slash-command-dispatcher was running for all comments, although we can only use them in pull requests. The github script would fail to get information about the PR when the job was run because of an issue comment.

While retesting in my fork, the transition from PAT to the workflow-level or job-level permissions were not correctly adjusted.

Proposed Changes

  1. Run only the command dispatcher on PR comments.
  2. Use only the required permissions for the jobs in the command dispatcher, or the commands.
  3. Use the new input name reactions for peter-evans/create-or-update-comment@v3.
  4. Add missing (but unneeded) inputs in the help command in order to successfully run.
  5. Bump actions/setup-python to v4.7.1, v4.5.0 is removed (seems they had a bug if a project had a pyproject.toml file).

Readiness Checklist

Author/Contributor

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

@echoix echoix added github_actions Pull requests that update Github_actions code automation infrastructure labels Oct 21, 2023
@echoix echoix requested a review from nvuillam as a code owner October 21, 2023 20:41
@echoix echoix temporarily deployed to dev October 21, 2023 20:41 — with GitHub Actions Inactive
@echoix echoix temporarily deployed to dev October 21, 2023 20:45 — with GitHub Actions Inactive
@echoix echoix temporarily deployed to dev October 21, 2023 20:46 — with GitHub Actions Inactive
Copy link
Member

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @echoix :)

@nvuillam nvuillam merged commit 09b8f0d into oxsecurity:main Oct 22, 2023
3 checks passed
@echoix echoix deleted the Slash-command-PR-Comment-only branch October 22, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation github_actions Pull requests that update Github_actions code infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants