diff --git a/.github/actions/composite/setupGitForOSBotify/action.yml b/.github/actions/composite/setupGitForOSBotify/action.yml index adf90789976c..3382fab18eae 100644 --- a/.github/actions/composite/setupGitForOSBotify/action.yml +++ b/.github/actions/composite/setupGitForOSBotify/action.yml @@ -5,6 +5,9 @@ inputs: OP_SERVICE_ACCOUNT_TOKEN: description: "1Password service account token" required: true + OP_VAULT: + description: "1Password vault to read the GPG private key from" + required: true runs: using: composite @@ -16,7 +19,7 @@ runs: shell: bash env: OP_SERVICE_ACCOUNT_TOKEN: ${{ inputs.OP_SERVICE_ACCOUNT_TOKEN }} - run: op read "op://${{ vars.OP_VAULT }}/OSBotify-private-key.asc/OSBotify-private-key.asc" --force --out-file ./OSBotify-private-key.asc + run: op read "op://${{ inputs.OP_VAULT }}/OSBotify-private-key.asc/OSBotify-private-key.asc" --force --out-file ./OSBotify-private-key.asc - name: Import OSBotify GPG Key shell: bash diff --git a/.github/actions/composite/setupGitForOSBotifyApp/action.yml b/.github/actions/composite/setupGitForOSBotifyApp/action.yml index 559bff9a648b..053e8c9cc4eb 100644 --- a/.github/actions/composite/setupGitForOSBotifyApp/action.yml +++ b/.github/actions/composite/setupGitForOSBotifyApp/action.yml @@ -14,6 +14,9 @@ inputs: OS_BOTIFY_PRIVATE_KEY: description: "OS Botify's private key" required: true + OP_VAULT: + description: "1Password vault to read the GPG private key from" + required: true outputs: # Do not try to use this for committing code. Use `secrets.OS_BOTIFY_COMMIT_TOKEN` instead @@ -31,7 +34,7 @@ runs: shell: bash env: OP_SERVICE_ACCOUNT_TOKEN: ${{ inputs.OP_SERVICE_ACCOUNT_TOKEN }} - run: op read "op://${{ vars.OP_VAULT }}/OSBotify-private-key.asc/OSBotify-private-key.asc" --force --out-file ./OSBotify-private-key.asc + run: op read "op://${{ inputs.OP_VAULT }}/OSBotify-private-key.asc/OSBotify-private-key.asc" --force --out-file ./OSBotify-private-key.asc - name: Import OSBotify GPG Key shell: bash diff --git a/.github/workflows/cherryPick.yml b/.github/workflows/cherryPick.yml index 5816de115e86..c12c0d63cdc4 100644 --- a/.github/workflows/cherryPick.yml +++ b/.github/workflows/cherryPick.yml @@ -25,11 +25,12 @@ jobs: - name: Set up git for OSBotify id: setupGitForOSBotify - uses: ./.github/actions/composite/setupGitForOSBotifyApp + uses: Expensify/GitHub-Actions/setupGitForOSBotify@main with: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }} OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }} + OP_VAULT: ${{ vars.OP_VAULT }} - name: Get previous app version id: getPreviousVersion diff --git a/.github/workflows/createNewVersion.yml b/.github/workflows/createNewVersion.yml index 34fea70f9dac..d1ff6bc9c6eb 100644 --- a/.github/workflows/createNewVersion.yml +++ b/.github/workflows/createNewVersion.yml @@ -32,6 +32,9 @@ on: OP_SERVICE_ACCOUNT_TOKEN: description: 1Password service account token required: true + OS_BOTIFY_APP_ID: + description: Application ID for OS Botify + required: true jobs: createNewVersion: @@ -61,10 +64,13 @@ jobs: OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }} - name: Setup git for OSBotify - uses: ./.github/actions/composite/setupGitForOSBotify + uses: Expensify/GitHub-Actions/setupGitForOSBotify@main id: setupGitForOSBotify with: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }} + SETUP_AS_APP: false + OP_VAULT: ${{ vars.OP_VAULT }} - name: Generate new E/App version id: bumpVersion diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e0d8d0db7119..699218d4e0a3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,12 +29,13 @@ jobs: OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }} - name: Setup git for OSBotify - uses: ./.github/actions/composite/setupGitForOSBotifyApp + uses: Expensify/GitHub-Actions/setupGitForOSBotify@main id: setupGitForOSBotify with: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }} OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }} + OP_VAULT: ${{ vars.OP_VAULT }} - name: Get app version id: getAppVersion diff --git a/.github/workflows/finishReleaseCycle.yml b/.github/workflows/finishReleaseCycle.yml index ca030e95de1d..fcb5670b8c16 100644 --- a/.github/workflows/finishReleaseCycle.yml +++ b/.github/workflows/finishReleaseCycle.yml @@ -19,12 +19,13 @@ jobs: token: ${{ secrets.OS_BOTIFY_TOKEN }} - name: Setup git for OSBotify - uses: ./.github/actions/composite/setupGitForOSBotifyApp + uses: Expensify/GitHub-Actions/setupGitForOSBotify@main id: setupGitForOSBotify with: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }} OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }} + OP_VAULT: ${{ vars.OP_VAULT }} - name: Validate actor is deployer id: isDeployer @@ -85,11 +86,12 @@ jobs: - name: Setup git for OSBotify id: setupGitForOSBotify - uses: ./.github/actions/composite/setupGitForOSBotifyApp + uses: Expensify/GitHub-Actions/setupGitForOSBotify@main with: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }} OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }} + OP_VAULT: ${{ vars.OP_VAULT }} - name: Update production branch run: | @@ -126,11 +128,12 @@ jobs: token: ${{ secrets.OS_BOTIFY_TOKEN }} - name: Setup git for OSBotify - uses: ./.github/actions/composite/setupGitForOSBotifyApp + uses: Expensify/GitHub-Actions/setupGitForOSBotify@main with: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }} OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }} + OP_VAULT: ${{ vars.OP_VAULT }} - name: Update staging branch to trigger staging deploy run: | diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 10ca10882464..f4e1f8849d90 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -102,11 +102,12 @@ jobs: token: ${{ secrets.OS_BOTIFY_TOKEN }} - name: Setup Git for OSBotify - uses: ./.github/actions/composite/setupGitForOSBotifyApp + uses: Expensify/GitHub-Actions/setupGitForOSBotify@main with: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }} OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }} + OP_VAULT: ${{ vars.OP_VAULT }} - name: Update staging branch from main run: |