attempt 1 to fix linter issues
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
name: E2E Test
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
runs_on:
|
||||
description: 'Platform to run publish-immutable-action on'
|
||||
default: 'ubuntu-latest'
|
||||
type: choice
|
||||
options:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
e2e-test:
|
||||
name: E2E Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Send message to consumer to publish
|
||||
id: send-message
|
||||
run: |
|
||||
echo "SHA: ${{ github.sha }}"
|
||||
curl -s -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.PAT }}" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/immutable-actions/test-publish-internal-ts-action/dispatches \
|
||||
-d '{"event_type":"e2e-test","client_payload":{"unit":false,"integration":true,"sha":"${{ github.sha }}","runs_on":"${{ inputs.runs_on }}"}}'
|
||||
- name: Wait for successful publish
|
||||
id: wait-for-successful-publish
|
||||
run: |
|
||||
START_TIME="$SECONDS"
|
||||
TIMESTAMP="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
while (( SECONDS - START_TIME < 90 )); do
|
||||
echo "Polling for workflow created after $TIMESTAMP"
|
||||
RESULT=$(curl -s -L -H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.PAT }}" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
"https://api.github.com/repos/immutable-actions/test-publish-internal-ts-action/actions/runs?created=>$TIMESTAMP" \
|
||||
| jq '.workflow_runs[] | select(.name=="Publish Actions Package" and (.display_title | contains("${{ github.sha }}"))) | .status, .conclusion')
|
||||
|
||||
# split the RESULT into an array
|
||||
mapfile -t RESULT <<< "$RESULT"
|
||||
STATUS=$(echo "${RESULT[0]}" | sed -e 's/^"//' -e 's/"$//')
|
||||
CONCLUSION=$(echo "${RESULT[1]}" | sed -e 's/^"//' -e 's/"$//')
|
||||
if [ -z "$STATUS" ]; then
|
||||
echo "No workflow found yet"
|
||||
else
|
||||
echo "Workflow status: $STATUS"
|
||||
echo "Workflow conclusion: $CONCLUSION"
|
||||
if [ "$STATUS" = "completed" ]; then
|
||||
if [ "$CONCLUSION" = "success" ]; then
|
||||
echo "workflow succeeded"
|
||||
exit 0
|
||||
elif [ "$CONCLUSION" = "failure" ]; then
|
||||
echo "workflow failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
done
|
||||
exit 2
|
||||
@@ -7,7 +7,7 @@
|
||||
This action packages _your action_ as an [OCI container](https://opencontainers.org/) and publishes it to the [GitHub Container registry](https://ghcr.io).
|
||||
This allows your action to be consumed as an _immutable_ package if a [SemVer](https://semver.org/) is specified in the consumer's workflow file.
|
||||
|
||||
Your workflow can be triggered by any [event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) which has a `GITHUB_REF` that points to a git tag.
|
||||
Your workflow can be triggered by any [event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) which has a `GITHUB_REF` that points to a Git tag.
|
||||
Some examples of these events are:
|
||||
|
||||
- [`release`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release) (uses tag associated with release)
|
||||
|
||||
+5
-5
@@ -22,8 +22,8 @@ latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
|
||||
|
||||
# if the latest_tag is empty, then there are no tags - let the user know
|
||||
if [[ -z "$latest_tag" ]]; then
|
||||
echo -e "No tags found (yet) - continue to create your first tag and push it"
|
||||
latest_tag="[unknown]"
|
||||
echo -e "No tags found (yet) - continue to create your first tag and push it"
|
||||
latest_tag="[unknown]"
|
||||
fi
|
||||
|
||||
echo -e "The latest release tag is: ${BLUE}${latest_tag}${OFF}"
|
||||
@@ -31,10 +31,10 @@ read -r -p 'New Release Tag (vX.X.X format): ' new_tag
|
||||
|
||||
tag_regex='v[0-9]+\.[0-9]+\.[0-9]+$'
|
||||
if echo "$new_tag" | grep -q -E "$tag_regex"; then
|
||||
echo -e "Tag: ${BLUE}$new_tag${OFF} is valid"
|
||||
echo -e "Tag: ${BLUE}$new_tag${OFF} is valid"
|
||||
else
|
||||
echo -e "Tag: ${BLUE}$new_tag${OFF} is ${RED}not valid${OFF} (must be in vX.X.X format)"
|
||||
exit 1
|
||||
echo -e "Tag: ${BLUE}$new_tag${OFF} is ${RED}not valid${OFF} (must be in vX.X.X format)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git tag -a "$new_tag" -m "$new_tag Release"
|
||||
|
||||
Reference in New Issue
Block a user