Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 7 additions & 52 deletions .github/workflows/safe-settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Apply Safe Settings
name: Apply Admin Safe Settings
on:
workflow_dispatch:
inputs:
Expand All @@ -14,54 +14,9 @@ jobs:
apply-safe-settings:
permissions:
contents: read
runs-on: ubuntu-24.04
environment: ${{ github.ref_name == github.event.repository.default_branch && 'production' || 'test' }}
env:
# Version/tag of `github/safe-settings` repository to use:
SAFE_SETTINGS_VERSION: ff7a65655d33006b9820479df0a9e1057a8927e4 # 2.1.17

# Path on GHA runner box where safe-settings code downloaded to:
SAFE_SETTINGS_CODE_DIR: .safe-settings-code
steps:
# Self-checkout of 'admin' repo for access to safe-settings deployment configuration
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

# Checkout of `safe-settings` source repository to apply all settings
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: github/safe-settings
ref: ${{ env.SAFE_SETTINGS_VERSION }}
path: ${{ env.SAFE_SETTINGS_CODE_DIR }}
persist-credentials: false
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: npm
cache-dependency-path: ${{ env.SAFE_SETTINGS_CODE_DIR }}/package-lock.json
node-version-file: ${{ env.SAFE_SETTINGS_CODE_DIR }}/.nvmrc
- run: npm install
working-directory: ${{ env.SAFE_SETTINGS_CODE_DIR }}
- name: Run Safe-Settings Full-Sync
run: |
set +e # Allow commands to fail
npm run full-sync
exit_code=$?
echo "Full-sync exit code: $exit_code"

if [[ "$FULL_SYNC_NOP" == "true" ]]; then
echo "Dry-run mode — ignoring failure"
exit 0
fi

exit $exit_code
working-directory: ${{ env.SAFE_SETTINGS_CODE_DIR }}
env:
APP_ID: ${{ vars.SAFE_SETTINGS_APP_ID }}
ADMIN_REPO: ${{ vars.SAFE_SETTINGS_ADMIN_REPO || '.github' }}
CONFIG_PATH: ${{ vars.SAFE_SETTINGS_CONFIG_PATH || 'safe-settings' }}
DEPLOYMENT_CONFIG_FILE: ${{ github.workspace }}/${{ vars.SAFE_SETTINGS_CONFIG_PATH || 'safe-settings' }}/deployment-settings.yml
FULL_SYNC_NOP: ${{ inputs.dry-run }}
GH_ORG: ${{ vars.SAFE_SETTINGS_GH_ORG }}
LOG_LEVEL: ${{ vars.SAFE_SETTINGS_LOG_LEVEL || 'debug' }}
PRIVATE_KEY: ${{ secrets.SAFE_SETTINGS_PRIVATE_KEY }}
# This is required to work with environment secrets in the called workflow
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: ./.github/workflows/libsafe-settings.yml
with:
admin-repo: admin
dry-run: ${{ inputs.dry-run }}
Loading