-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chore/update-actions-cache
- Loading branch information
Showing
32 changed files
with
86,643 additions
and
106,367 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"gha-workflow-validator": patch | ||
--- | ||
|
||
fix: action reference validation bug producing false positives for lines which | ||
contain "uses:" substring, but is not an action reference |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# release-tag-check | ||
|
||
## 0.1.0 | ||
|
||
### Minor Changes | ||
|
||
- [#767](https://github.com/smartcontractkit/.github/pull/767) | ||
[`649140f`](https://github.com/smartcontractkit/.github/commit/649140f2b55da65959308403fff0e812c0b794e7) | ||
Thanks [@chainchad](https://github.com/chainchad)! - Migrate release-tag-check | ||
action from chainlink-github-actions repo |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Release Tag Check | ||
|
||
Checks if git tag is a release or pre-release, and tells you the version. | ||
|
||
## Inputs | ||
|
||
These are passed by setting environment variables. | ||
|
||
- GITHUB_REF | ||
- Automatically available in a Github workflow. Will only work with `tag` | ||
pushes, otherwise the extracted ref will have an extra `/` | ||
- If a tag is the git ref, the prefix will be `refs/tags/`, if a branch is the | ||
git ref, the prefix will be `refs/heads/` (10 characters vs 11 characters). | ||
- RELEASE_REGEX | ||
- Used to determine if the tag pushed is the expected format of a release | ||
- Defaults to: `^v[0-9]+\.[0-9]+\.[0-9]+$` | ||
- PRE_RELEASE_REGEX | ||
- Used to determine if the tag pushed is the expected format of a pre-release | ||
- Defaults to: `^v[0-9]+\.[0-9]+\.[0-9]+-(.+)$` | ||
- VERSION_PREFIX | ||
- Used for determining the `release-version` and `pre-release-version` outputs | ||
only. This will not affect how the release/pre-release regexes determine the | ||
output. | ||
- Defaults to: `v` | ||
|
||
## Outputs | ||
|
||
- `is-release` - whether the tag name conformed to the release regex | ||
(`refs/tag/<tag name>`) | ||
- If yes, `release-version` should be set to the version. Without the | ||
`$VERSION_PREFIX` on the tag name | ||
- `is-pre-release` whether the tag name conformed to the pre-release regex | ||
(`refs/tag/<tag name>`) | ||
- If yes, `pre-release-version` should be set to the version. Without the | ||
`$VERSION_PREFIX` on the tag name | ||
|
||
## Examples | ||
|
||
1. Ref: refs/tag/v1.2.3-beta.0 | ||
- is-pre-release: true | ||
- is-release: false | ||
- pre-release-version: 1.2.3-beta.0 | ||
- release-version: null | ||
2. Ref: refs/tag/v1.2.3 | ||
- is-pre-release: false | ||
- is-release: true | ||
- pre-release-version: null | ||
- release-version: 1.2.3 | ||
3. Ref: refs/tag/release-v1.2.3 (must override release_regex, and | ||
VERSION_PREFIX) | ||
- is-pre-release: false | ||
- is-release: true | ||
- pre-release-version: null | ||
- release-version: 1.2.3 | ||
4. Ref: refs/head/v1.2.3 | ||
- is-pre-release: false | ||
- is-release: false | ||
- pre-release-version: null | ||
- release-version: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Release tag check | ||
description: Indicates whether a GitHub ref is a pre-release or a final release. | ||
outputs: | ||
is-pre-release: | ||
description: "`true` if the release is a pre-release" | ||
value: ${{ steps.check.outputs.is-pre-release }} | ||
is-release: | ||
description: "`true if the release is final" | ||
value: ${{ steps.check.outputs.is-release }} | ||
release-version: | ||
description: "The version of the release" | ||
value: ${{ steps.check.outputs.release-version }} | ||
pre-release-version: | ||
description: "The version of the pre-release" | ||
value: ${{ steps.check.outputs.pre-release-version }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Check release tag | ||
id: check | ||
shell: bash | ||
run: ${{ github.action_path }}/scripts/releasetagcheck.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "release-tag-check", | ||
"version": "0.1.0", | ||
"description": "Indicates whether a GitHub ref is a pre-release or a final release", | ||
"private": true, | ||
"scripts": {}, | ||
"author": "@smartcontractkit", | ||
"license": "MIT", | ||
"dependencies": {}, | ||
"repository": "https://github.com/smartcontractkit/.github" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "release-tag-check", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "actions/release-tag-check", | ||
"targets": {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Configurable regex patterns with defaults | ||
RELEASE_REGEX=${RELEASE_REGEX:-"^v[0-9]+\.[0-9]+\.[0-9]+$"} | ||
PRE_RELEASE_REGEX=${PRE_RELEASE_REGEX:-"^v[0-9]+\.[0-9]+\.[0-9]+-(.+)$"} | ||
|
||
# Configurable prefix removal with default | ||
VERSION_PREFIX=${VERSION_PREFIX:-"v"} | ||
|
||
if [[ -z "${GITHUB_REF:-}" ]]; then | ||
echo "ERROR: GITHUB_REF environment variable is required" | ||
exit 1 | ||
fi | ||
|
||
TAG_REF="${GITHUB_REF}" | ||
TAG_NAME=${TAG_REF:10} # remove "refs/tags/" prefix | ||
|
||
# Remove specified prefix from the version tag | ||
VERSION_TAG=${TAG_NAME#"${VERSION_PREFIX}"} | ||
|
||
echo "Tag: $TAG_NAME" | ||
echo "Checking if $TAG_NAME is a release or pre-release tag..." | ||
|
||
IS_RELEASE=false | ||
IS_PRE_RELEASE=false | ||
RELEASE_VERSION="null" | ||
PRE_RELEASE_VERSION="null" | ||
|
||
if [[ $TAG_NAME =~ $RELEASE_REGEX ]]; then | ||
echo "Release tag detected. Tag: $TAG_NAME - Version: $VERSION_TAG" | ||
IS_RELEASE=true | ||
RELEASE_VERSION=$VERSION_TAG | ||
elif [[ $TAG_NAME =~ $PRE_RELEASE_REGEX ]]; then | ||
echo "Pre-release tag detected. Tag: $TAG_NAME - Version: $VERSION_TAG" | ||
IS_PRE_RELEASE=true | ||
PRE_RELEASE_VERSION=$VERSION_TAG | ||
else | ||
echo "No release or pre-release tag detected. Tag: $TAG_NAME" | ||
fi | ||
|
||
echo "is-release=$IS_RELEASE" | tee -a "$GITHUB_OUTPUT" | ||
echo "release-version=$RELEASE_VERSION" | tee -a "$GITHUB_OUTPUT" | ||
|
||
echo "is-pre-release=$IS_PRE_RELEASE" | tee -a "$GITHUB_OUTPUT" | ||
echo "pre-release-version=$PRE_RELEASE_VERSION" | tee -a "$GITHUB_OUTPUT" |
Oops, something went wrong.