Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CI script to automatically update a git tag #2530

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
schedule:
- cron: '0 7 * * 2'
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest

permissions:
checks: read
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check that the CI is passing
uses: actions/github-script@v7
with:
script: |
const checks = await github.rest.checks.listForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: '${{github.event.repository.default_branch}}',
});

const isSuccessful = checks.data.check_runs
.filter((run) => run.name !== process.env.GITHUB_JOB)
.every((run) => run.conclusion === 'success');

if (!isSuccessful) {
core.error('Not creating a release because the CI is failing.');
process.exit(1);
}

- name: Update git tag
uses: EndBug/latest-tag@latest
with:
ref: latest
Loading