fix: add missing nop param for full-sync#733
fix: add missing nop param for full-sync#733decyjphr merged 3 commits intogithub:main-enterprisefrom
Conversation
|
Nice! maybe you can update the readme too? |
Yes, I agree that updating the documentation would be beneficial. I think it would be more appropriate to create a separate PR for GHA documentation updates, as I'm planning to make other documentation improvements unrelated to this PR. But if updating GHA documentation in this current PR is required to merge it, I can update it. |
fd14365 to
ef70108
Compare
lib/env.js
Outdated
| CREATE_ERROR_ISSUE: process.env.CREATE_ERROR_ISSUE || 'true', | ||
| BLOCK_REPO_RENAME_BY_HUMAN: process.env.BLOCK_REPO_RENAME_BY_HUMAN || 'false' | ||
| BLOCK_REPO_RENAME_BY_HUMAN: process.env.BLOCK_REPO_RENAME_BY_HUMAN || 'false', | ||
| FULL_SYNC_NOOP: process.env.FULL_SYNC_NOOP === 'true' |
There was a problem hiding this comment.
We have different implementations for boolean environment variables.
For example, CREATE_PR_COMMENT is handled as a string, while with this changes FULL_SYNC_NOP is implemented as a boolean value. This is reflected in the different approaches in our unit tests.
I think it would be beneficial to standardize how we handle boolean environment variables across the project. Once we decide on the preferred implementation (string or boolean), I can create a new PR to refactor the existing code for consistency.
I can also update my changes to fit current implementation.
ef70108 to
8f2353e
Compare
55f3064 to
f1d6b7b
Compare
f1d6b7b to
9b2a0d6
Compare
|
This would be very useful! |
|
I would love to see this implemented! |
|
@PendaGTP I like the approach of treating env variables as boolean. I will create a PR for making the rest also as boolean. |
Related to #378 (#378 (comment))
Now the full-sync script will use the new env var
FULL_SYNC_NOOPand so run is noop mode if true.This helps run safe-settings GHA since you can add this var conditionaly based on event.
Example (based from https://github.com/UCL-MIRSG/.github/blob/4695e545829b91dcddc6e36358454bc4a879f751/.github/workflows/safe-settings.yaml thanks @paddyroddy) :