Skip to content

ci: refactored actions to be more reusable #770

ci: refactored actions to be more reusable

ci: refactored actions to be more reusable #770

Workflow file for this run

name: Update lockfile
on:
workflow_call:
secrets:
GITHUB_TOKEN:

Check failure on line 6 in .github/workflows/update-lockfile.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/update-lockfile.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
setup:
uses: ./.github/workflows/setup.yml
with:
node-version: '22.12.0'
pnpm-version: '9.15.1'
check_lockfile:
name: Check lockfile status
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install without frozen lockfile
run: pnpm install --no-frozen-lockfile
- name: Configure CI Git User
run: |
git config --global user.name 'Danilo Velasquez'
git config --global user.email '[email protected]'
git config --global --add safe.directory /github/workspace
git remote set-url origin https://[email protected]/dvelasquez/lighthouse-viewer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update lockfile
run: |
if [[ -n "$(git status --porcelain pnpm-lock.yaml)" ]]; then
echo "Lockfile is outdated, updating..."
git add pnpm-lock.yaml
git commit -m "chore: update lockfile [skip ci]"
git push
else
echo "No changes to commit in pnpm-lock.yaml"
fi