refresh-session #514
This file contains 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
name: refresh-session | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '23 1 * * *' # Every day at 1:23 AM UTC | |
jobs: | |
refresh-session: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Install browsers | |
run: pnpm playwright install chromium | |
- name: Install 1Password CLI | |
uses: 1password/install-cli-action@v1 | |
- name: Configure 1Password Service Account | |
uses: 1password/load-secrets-action/configure@v1 | |
with: | |
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
- name: Load credentials | |
uses: 1password/load-secrets-action@v1 | |
env: | |
USERNAME: op://actions-oidc/GitHub - depot-public-oidc/username | |
PASSWORD: op://actions-oidc/GitHub - depot-public-oidc/password | |
- name: Load OTP token | |
run: | | |
export OTP="$(op item get --vault 'actions-oidc' 'GitHub - depot-public-oidc' --otp)" | |
echo "::add-mask::$OTP" | |
echo "OTP=$OTP" >> "$GITHUB_ENV" | |
- name: Refresh session | |
run: pnpm refresh-session || pnpm refresh-session | |
env: | |
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }} | |
- name: Save screenshot | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: screenshot | |
path: tmp/screenshot.png |