Assets #65
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: Assets | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 * * *' | |
jobs: | |
assets: | |
name: Update local assets | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'ghostery' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install | |
- name: Fetch latest assets | |
id: critical_step | |
run: bun run update-mappings | |
continue-on-error: true | |
- name: Check if critical step should skip workflow | |
run: | | |
if [ "${{ steps.critical_step.outcome }}" != "success" ]; then | |
echo "skip=true" >> $GITHUB_ENV | |
else | |
echo "skip=false" >> $GITHUB_ENV | |
fi | |
- uses: tibdex/github-app-token@v1 | |
if: env.skip == 'false' | |
id: generate-token | |
with: | |
app_id: ${{ secrets.ADBLOCKERBOT_APP_ID }} | |
private_key: ${{ secrets.ADBLOCKERBOT_PRIVATE_KEY }} | |
- name: Create Pull Request | |
if: env.skip == 'false' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
committer: Ghostery Adblocker Bot <[email protected]> | |
author: Ghostery Adblocker Bot <[email protected]> | |
commit-message: "Update redirect resources mappings" | |
title: "Update local assets" | |
body: "Automated update of local redirect resources mappings." | |
branch: update-assets | |
labels: "PR: Internal :house:" | |
- name: Check outputs | |
if: env.skip == 'false' | |
run: | | |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}" |