From b6fba50f69e6883c564b28b1a90473a3ff215df4 Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Tue, 25 Feb 2025 12:15:24 +0100 Subject: [PATCH] Some cleanup --- .github/workflows/build.yml | 2 +- dist/index.js | 2 +- docs/development.md | 11 +++++------ package.json | 10 +++++----- scripts/craft-pre-release.sh | 2 +- ...ch-docker-tag.sh => set-docker-tag-from-branch.sh} | 0 6 files changed, 13 insertions(+), 14 deletions(-) rename scripts/{set-branch-docker-tag.sh => set-docker-tag-from-branch.sh} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b3a3ed..1c2139a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: if [[ "${{ github.event_name }}" == "pull_request" ]]; then if [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Error: DOCKER_TAG ($TAG) is not allowed to match `MAJOR.MINOR.PATCH` inside a pull request." + echo "Error: DOCKER_TAG ($TAG) is not allowed to match `MAJOR.MINOR.PATCH` format inside a pull request." echo "Please rename the docker tag in `action.yml` and try again." exit 1 fi diff --git a/dist/index.js b/dist/index.js index 8b46164..0260004 100644 --- a/dist/index.js +++ b/dist/index.js @@ -123585,7 +123585,7 @@ module.exports = JSON.parse('{"eN":{"H":"https://github.com/elastic/require-in-t /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"action-release","version":"1.10.5","private":true,"description":"GitHub Action for creating a release on Sentry","main":"dist/index.js","scripts":{"start":"node dist/index.js","build":"ncc build src/main.ts -e @sentry/cli","format":"prettier --write **/*.ts **/*.md","format-check":"prettier --check **/*.ts **/*.md","lint":"eslint src/**/*.ts","test":"jest","all":"yarn run format && yarn run lint && yarn run build && yarn test","bump-docker-tag":"./scripts/set-docker-tag.sh","bump-docker-tag-from-branch":"./scripts/set-branch-docker-tag.sh"},"repository":{"type":"git","url":"git+https://github.com/getsentry/action-release.git"},"keywords":["actions","sentry","release"],"author":"Sentry","license":"MIT","dependencies":{"@actions/core":"^1.11.1","@sentry/node":"^8.54.0","@sentry/cli":"^2.41.1"},"devDependencies":{"@types/jest":"^29.5.6","@types/node":"^20.8.9","@typescript-eslint/parser":"^6.9.0","@vercel/ncc":"^0.38.1","eslint":"^8.52.0","eslint-plugin-github":"^4.10.1","eslint-plugin-jest":"^27.4.3","jest":"^29.7.0","jest-circus":"^29.7.0","js-yaml":"^4.1.0","prettier":"^3.0.3","ts-jest":"^29.1.1","typescript":"^5.2.2"},"volta":{"node":"18.17.0","yarn":"1.22.4"}}'); +module.exports = JSON.parse('{"name":"action-release","version":"1.10.5","private":true,"description":"GitHub Action for creating a release on Sentry","main":"dist/index.js","scripts":{"all":"yarn run format && yarn run lint && yarn run build && yarn test","build":"ncc build src/main.ts -e @sentry/cli","format":"prettier --write **/*.ts **/*.md","format-check":"prettier --check **/*.ts **/*.md","lint":"eslint src/**/*.ts","set-docker-tag":"./scripts/set-docker-tag.sh","set-docker-tag-from-branch":"./scripts/set-docker-tag-from-branch.sh","start":"node dist/index.js","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/getsentry/action-release.git"},"keywords":["actions","sentry","release"],"author":"Sentry","license":"MIT","dependencies":{"@actions/core":"^1.11.1","@sentry/node":"^8.54.0","@sentry/cli":"^2.41.1"},"devDependencies":{"@types/jest":"^29.5.6","@types/node":"^20.8.9","@typescript-eslint/parser":"^6.9.0","@vercel/ncc":"^0.38.1","eslint":"^8.52.0","eslint-plugin-github":"^4.10.1","eslint-plugin-jest":"^27.4.3","jest":"^29.7.0","jest-circus":"^29.7.0","js-yaml":"^4.1.0","prettier":"^3.0.3","ts-jest":"^29.1.1","typescript":"^5.2.2"},"volta":{"node":"18.17.0","yarn":"1.22.4"}}'); /***/ }) diff --git a/docs/development.md b/docs/development.md index 1525cea..25b797f 100644 --- a/docs/development.md +++ b/docs/development.md @@ -40,14 +40,13 @@ Telemetry for internal development is collected using `@sentry/node`, see `src/t Members of this repo will not have to set anything up since [the integration](https://sentry-ecosystem.sentry.io/settings/developer-settings/end-to-end-action-release-integration-416eb2/) is already set-up. Just open the PR and you will see [a release created](https://sentry-ecosystem.sentry.io/releases/?project=4505075304693760) for your PR. > [!WARNING] -> After you create a branch **ALWAYS** run `yarn bump-docker-tag-from-branch`. -> This is **very important**. You should avoid publishing changes to an already existing docker image, -> especially to docker images tagged with release versions, e.g. `1.11.0`. -> -> **Never** write a version tag into `action.yml` yourself, let the release process handle this. +> After you create a branch **ALWAYS** run `yarn set-docker-tag-from-branch`. +> This is **very important**. You should avoid publishing changes to an already existing docker image. +> +> Docker tags in action.yml that match `MAJOR.MINOR.PATCH` will be rejected by the CI on pull requests. 1. Create a branch -2. Run `yarn bump-docker-tag-from-branch` to set a docker tag based on your github branch name. This is important so that the action gets its own Docker image, allowing you to test the action in a different repo. +2. Run `yarn set-docker-tag-from-branch` to set a docker tag based on your github branch name. This is important so that the action gets its own Docker image, allowing you to test the action in a different repo. 3. Make changes 4. If possible, add unit and E2E tests (inside `.github/workflows/build.yml`) 5. Run `yarn install` to install deps diff --git a/package.json b/package.json index ccc45b6..704c2e1 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,15 @@ "description": "GitHub Action for creating a release on Sentry", "main": "dist/index.js", "scripts": { - "start": "node dist/index.js", + "all": "yarn run format && yarn run lint && yarn run build && yarn test", "build": "ncc build src/main.ts -e @sentry/cli", "format": "prettier --write **/*.ts **/*.md", "format-check": "prettier --check **/*.ts **/*.md", "lint": "eslint src/**/*.ts", - "test": "jest", - "all": "yarn run format && yarn run lint && yarn run build && yarn test", - "bump-docker-tag": "./scripts/set-docker-tag.sh", - "bump-docker-tag-from-branch": "./scripts/set-branch-docker-tag.sh" + "set-docker-tag": "./scripts/set-docker-tag.sh", + "set-docker-tag-from-branch": "./scripts/set-docker-tag-from-branch.sh", + "start": "node dist/index.js", + "test": "jest" }, "repository": { "type": "git", diff --git a/scripts/craft-pre-release.sh b/scripts/craft-pre-release.sh index 54c7256..292ace5 100755 --- a/scripts/craft-pre-release.sh +++ b/scripts/craft-pre-release.sh @@ -18,4 +18,4 @@ npm version "${NEW_VERSION}" yarn install && yarn build # Update the docker tag in action.yml -yarn bump-docker-tag "${NEW_VERSION}" +yarn set-docker-tag "${NEW_VERSION}" diff --git a/scripts/set-branch-docker-tag.sh b/scripts/set-docker-tag-from-branch.sh similarity index 100% rename from scripts/set-branch-docker-tag.sh rename to scripts/set-docker-tag-from-branch.sh