From abf929b7e44d781462a9bb42ae1b3ecd548ce924 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:05:08 +0000 Subject: [PATCH 1/8] Bump super-linter/super-linter from 5 to 6 Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 5 to 6. - [Release notes](https://github.com/super-linter/super-linter/releases) - [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md) - [Commits](https://github.com/super-linter/super-linter/compare/v5...v6) --- updated-dependencies: - dependency-name: super-linter/super-linter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index dc8a94d..524c562 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -36,7 +36,7 @@ jobs: - name: Lint Code Base id: super-linter - uses: super-linter/super-linter/slim@v5 + uses: super-linter/super-linter/slim@v6 env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 67f4b7749e8edc65afdcad4cb5bba347e563999b Mon Sep 17 00:00:00 2001 From: Sneha Kripanandan <110618720+sneha-krip@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:51:33 -0400 Subject: [PATCH 2/8] Set fetch-depth for checkout when using super-linter --- .github/workflows/linter.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 524c562..6e6f50c 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -22,6 +22,9 @@ jobs: - name: Checkout id: checkout uses: actions/checkout@v4 + # this is necessary based on https://github.com/super-linter/super-linter?tab=readme-ov-file#get-started + with: + fetch-depth: 0 - name: Setup Node.js id: setup-node From b40fcfc004eae770ea2b94c09989ec98c58215b0 Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Sat, 10 Aug 2024 10:56:12 +0100 Subject: [PATCH 3/8] attempt 1 to fix linter issues --- .github/workflows/ci-e2e.yml | 69 ------------------------------------ README.md | 2 +- script/release | 10 +++--- 3 files changed, 6 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/ci-e2e.yml diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml deleted file mode 100644 index b81ab77..0000000 --- a/.github/workflows/ci-e2e.yml +++ /dev/null @@ -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 diff --git a/README.md b/README.md index 08e385e..80b2fa1 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/script/release b/script/release index 0dd6139..8940bed 100755 --- a/script/release +++ b/script/release @@ -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" From 766a6934c5e3f5c4ccc2faac310fea301f9314c2 Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Sat, 10 Aug 2024 11:07:26 +0100 Subject: [PATCH 4/8] fix codeql permissions --- .github/workflows/codeql-analysis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 36c2b05..4a50b1c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -19,10 +19,8 @@ jobs: permissions: actions: read - checks: write contents: read security-events: write - packages: read strategy: fail-fast: false From 229ed049068ed930742cf4c7c525a5c4f149959f Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Sat, 10 Aug 2024 11:08:26 +0100 Subject: [PATCH 5/8] ignore tests in eslinter --- .eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintignore b/.eslintignore index 9ff5c1c..dfdf38e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,4 @@ lib/ dist/ node_modules/ coverage/ +__tests__/ \ No newline at end of file From e58130f44d305011aac0eb3491d279da6c32419a Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Sat, 10 Aug 2024 11:10:28 +0100 Subject: [PATCH 6/8] move permissions to top level --- .github/workflows/codeql-analysis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4a50b1c..91cff41 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,16 +12,16 @@ on: # schedule: # - cron: '31 7 * * 3' +permissions: + actions: read + contents: read + security-events: write + jobs: analyze: name: Analyze runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - strategy: fail-fast: false matrix: From 0fd4266160c134f902efca09fdd44f1d96ae8ec9 Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Sat, 10 Aug 2024 11:16:36 +0100 Subject: [PATCH 7/8] replace default style with validate env var See https://github.com/super-linter/super-linter/blob/main/docs/upgrade-guide.md#javascript_default_style-and-typescript_default_style --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 6e6f50c..246f80a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -43,6 +43,6 @@ jobs: env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TYPESCRIPT_DEFAULT_STYLE: prettier + VALIDATE_TYPESCRIPT_STANDARD: false VALIDATE_JSCPD: false FILTER_REGEX_EXCLUDE: .*/licenses\.txt$ From 50c672a35324e730c11800b3139de2569e0ed583 Mon Sep 17 00:00:00 2001 From: Conor Sloan Date: Sat, 10 Aug 2024 11:22:25 +0100 Subject: [PATCH 8/8] dont ignore tests in eslint --- .eslintignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index dfdf38e..9ff5c1c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,4 +2,3 @@ lib/ dist/ node_modules/ coverage/ -__tests__/ \ No newline at end of file