This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
Update Check #237
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: Update Check | |
env: | |
REPO_URL: https://github.com/mozilla/gecko-dev | |
REPO_BRANCH: master | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 16 * * 0,4 | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: write | |
steps: | |
- name: Get Commit Hash | |
id: get-hash | |
run: | | |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH --single-branch . | |
echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Cache and Compare Hash | |
id: cache-hash | |
uses: actions/cache@v3 | |
with: | |
path: .commit-hash | |
key: HEAD-${{ steps.get-hash.outputs.commit_hash }} | |
- name: Update Hash | |
id: update-hash | |
if: steps.cache-hash.outputs.cache-hit != 'true' | |
run: echo ${{ steps.get-hash.outputs.commit_hash }} | tee .commit-hash | |
- name: Trigger Build | |
id: trigger-build | |
if: steps.cache-hash.outputs.cache-hit != 'true' | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
event-type: firefox-source-code-update | |
- name: Delete Workflow Runs | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: 1 | |
keep_minimum_runs: 1 |