Bug fixes for "Member Activity Trigger", address edge cases#8324
Merged
t-will-gillis merged 16 commits intohackforla:gh-pagesfrom Oct 2, 2025
Merged
Conversation
34 tasks
|
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes. |
Member
Author
|
Hi @santiseccovidal I just made one fix- letting you know so you have the most recent version if you have started testing. |
daras-cu
approved these changes
Oct 2, 2025
Member
daras-cu
left a comment
There was a problem hiding this comment.
@t-will-gillis everything looks good to me, your explanations for the changes are clear and the GHA should function the same other than fixing the bugs in the specified edge cases. I think this is ready to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8323
What changes did you make?
activity-trigger.yml, added logic togithub-tokenso that it defaults togithub.tokenwhensecrets.HACKFORLA_GRAPHQL_TOKENis restricted for security reasons (i.e. "pull_request_review")activity-trigger.js,EXCLUDED_ACTORSis refactored to multi-lineassigneewas changed toeventObserver. The new variable refers to the primary assignee when available, or to the issue author if not. Note also that the primary issue assignee iscontext.payload.issue.assignees[0].login;for "issues.closed".else if (eventName === 'pull_request_review_comment') {actionMapto includepull_request_targetpost-to-skills-issue.js, added or revisedconsole.log()smessageincludes the words "closed" or "assigned"mutate-issue-status.js, addedreturn true;post-issue-comment.jsadded areturn true;Why did you make the changes (we will use this info to test)?
pull_request_reviewis the trigger the defined PAT is not available. To prevent the workflow error we need to explicitly define the default token. The odd expression is a simulated ternary operation: the simplegithub-token = ${{ secrets.HACKFORLA_GRAPHQL_TOKEN || github.token }}evaluates to a Boolean, and does not define which token to use. The expression shown bypasses the strict Boolean and evaluates togithub-token = github.tokenif the PAT is not accessible.console.log()messages help with debuggingpost-to-skills-issue.jsto post aconsole.log(), but does not affect other functions that are not expecting any return valueCodeQL Alerts
After the PR has been submitted and the resulting GitHub actions/checks have been completed, developers should check the PR for CodeQL alert annotations.
Check the PR's comments. If present on your PR, the CodeQL alert looks similar as shown
Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.
Instructions for resolving CodeQL alerts
If CodeQL alert/annotations appear, refer to How to Resolve CodeQL alerts.
In general, CodeQL alerts should be resolved prior to PR reviews and merging
Screenshots of Proposed Changes To The Website (if any, please do not include screenshots of code changes)
Notes to reviewers
If you are already set up for GHAs, that is have a local Project Board, know about the tokens and labels, etc.:
Following are some changes for testing. You can make some of the simpler changes to see that the pieces appear to work correctly, but to go "all the way" with the testing (for example, testing Archived issues, trying to force CodeQL to fire, etc.) will be much more involved and might not be needed:
Make sure your
HACKFORLA_GRAPHQL_TOKENis activeChange the default branch of your repo
Change line in
activity.trigger.ymlto refer to your own repo.Add a Skills Issue in your name to your project and assign it to yourself. Take note of the issue number and add it below.
The automation uses GraphQL queries to locate each user's Skills Issue and the bot comment. HfLA's project, status, and field ids are hard-coded in the file
github-actions/utils/_data/status-field-ids.js, so you will need to either tell the bot the number of your repo's Skills Issue:post-to-skills-issue.js, change:post-to-skills-issue.jsto:github-actions/utils/_data/status-field-ids.jsto match your repo's values using GitHub Explorer (at least until Nov 1, 2025). Here is how to find that info:Extracting Status Field Ids from personal repo
Finding your projNum
Example output from Explorer
After, you should be able to quickly test that a message is being posted to your temporary Skills Issue whenever you open, close, assign, and unassign issues, add a comment, and open and close PRs.