mirror of
https://github.com/ps5-linux/ps5-linux-image.git
synced 2026-07-15 21:42:27 +00:00
ci: move release commit tag
This commit is contained in:
16
.github/workflows/build-image.yml
vendored
16
.github/workflows/build-image.yml
vendored
@@ -169,6 +169,22 @@ jobs:
|
||||
echo 'EOF'
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Move latest tag to current commit
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const ref = 'tags/latest';
|
||||
try {
|
||||
await github.rest.git.updateRef({
|
||||
...context.repo, ref, sha: context.sha, force: true,
|
||||
});
|
||||
} catch (e) {
|
||||
if (e.status !== 422) throw e;
|
||||
await github.rest.git.createRef({
|
||||
...context.repo, ref: 'refs/tags/latest', sha: context.sha,
|
||||
});
|
||||
}
|
||||
|
||||
- name: Create or update release
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
|
||||
33
.github/workflows/move-release-tag.yml
vendored
Normal file
33
.github/workflows/move-release-tag.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Move release tag
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
commit:
|
||||
description: 'Commit SHA to point `latest` at (defaults to the selected ref)'
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
jobs:
|
||||
move-tag:
|
||||
runs-on: self-hosted
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Move latest tag to commit
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const ref = 'tags/latest';
|
||||
const sha = '${{ inputs.commit }}'.trim() || context.sha;
|
||||
try {
|
||||
await github.rest.git.updateRef({
|
||||
...context.repo, ref, sha, force: true,
|
||||
});
|
||||
} catch (e) {
|
||||
if (e.status !== 422) throw e;
|
||||
await github.rest.git.createRef({
|
||||
...context.repo, ref: 'refs/tags/latest', sha,
|
||||
});
|
||||
}
|
||||
core.info(`latest -> ${sha}`);
|
||||
Reference in New Issue
Block a user