11name : Apply Safe Settings
22on :
3- workflow_dispatch :
3+ workflow_call :
44 inputs :
5+ admin-repo :
6+ type : string
7+ default : .github
8+ app-id :
9+ required : true
10+ type : string
11+ config-path :
12+ type : string
13+ default : safe-settings
14+ deployment-config-file :
15+ type : string
16+ default : deployment-settings.yml
517 dry-run :
6- description : Whether to run in `dry-run` mode or not
7- required : false
818 type : boolean
919 default : true
20+ skip-dry-run-errors :
21+ type : boolean
22+ default : true
23+ secrets :
24+ private-key :
25+ required : true
1026
1127permissions : {}
1228
@@ -23,12 +39,11 @@ jobs:
2339 # Path on GHA runner box where safe-settings code downloaded to:
2440 SAFE_SETTINGS_CODE_DIR : .safe-settings-code
2541 steps :
26- # Self-checkout of 'admin' repo for access to safe-settings deployment configuration
42+ # Self-checkout to access deployment configuration
2743 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2844 with :
2945 persist-credentials : false
30-
31- # Checkout of `safe-settings` source repository to apply all settings
46+ # Checkout of `safe-settings` source repository to run app
3247 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3348 with :
3449 repository : github/safe-settings
@@ -43,25 +58,15 @@ jobs:
4358 - run : npm install
4459 working-directory : ${{ env.SAFE_SETTINGS_CODE_DIR }}
4560 - name : Run Safe-Settings Full-Sync
61+ continue-on-error : ${{ inputs.dry-run && inputs.skip-dry-run-errors }}
4662 run : |
47- set +e # Allow commands to fail
4863 npm run full-sync
49- exit_code=$?
50- echo "Full-sync exit code: $exit_code"
51-
52- if [[ "$FULL_SYNC_NOP" == "true" ]]; then
53- echo "Dry-run mode — ignoring failure"
54- exit 0
55- fi
56-
57- exit $exit_code
5864 working-directory : ${{ env.SAFE_SETTINGS_CODE_DIR }}
5965 env :
60- APP_ID : ${{ vars.SAFE_SETTINGS_APP_ID }}
61- ADMIN_REPO : ${{ vars.SAFE_SETTINGS_ADMIN_REPO || '.github' }}
62- CONFIG_PATH : ${{ vars.SAFE_SETTINGS_CONFIG_PATH || 'safe-settings' }}
63- DEPLOYMENT_CONFIG_FILE : ${{ github.workspace }}/${{ vars.SAFE_SETTINGS_CONFIG_PATH || 'safe-settings' }}/deployment-settings.yml
66+ APP_ID : ${{ inputs.app-id }}
67+ ADMIN_REPO : ${{ inputs.admin-repo }}
68+ CONFIG_PATH : ${{ inputs.config-path }}
69+ DEPLOYMENT_CONFIG_FILE : ${{ github.workspace }}/${{ inputs.config-path }}/${{ inputs. deployment-config-file }}
6470 FULL_SYNC_NOP : ${{ inputs.dry-run }}
65- GH_ORG : ${{ vars.SAFE_SETTINGS_GH_ORG }}
6671 LOG_LEVEL : ${{ vars.SAFE_SETTINGS_LOG_LEVEL || 'debug' }}
67- PRIVATE_KEY : ${{ secrets.SAFE_SETTINGS_PRIVATE_KEY }}
72+ PRIVATE_KEY : ${{ secrets.private-key }}
0 commit comments