From f0ea7b8c412bd3aa577a9c9f1567a1ea45f5f85a Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Mon, 21 Oct 2024 23:31:20 +0200 Subject: [PATCH 1/6] fix(setup): fix branches setup (#48) --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index f0c1e33..3d64ce7 100755 --- a/setup.sh +++ b/setup.sh @@ -16,7 +16,7 @@ if [ "${INPUT_DRYRUN}" == "true" ]; then else echo "+ Setup releasable branches" # shellcheck disable=SC2094 - cat <<<"$(jq --argjson branches "$(<"${GITHUB_ACTION_PATH}/branches.json")" '.release += {branches: $branches}' package.json)" >package.json + cat <<<"$(jq --argjson branches "$(<"${GITHUB_ACTION_PATH}"/branches.json)" '.release += {branches: $branches}' package.json)" >package.json fi if [ "${INPUT_WITHOUTPREFIX}" == "true" ]; then From 478159f7899913b87fbae3f9d080f310b3a3a49a Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Tue, 22 Oct 2024 00:21:54 +0200 Subject: [PATCH 2/6] fix: avoid collision on GITHUB_REF_NAME --- action.yml | 2 ++ setup.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 1ed382e..c931661 100644 --- a/action.yml +++ b/action.yml @@ -56,6 +56,8 @@ runs: using: 'composite' steps: - uses: rlespinasse/github-slug-action@v4 + with: + prefix: RT_ - run: $GITHUB_ACTION_PATH/setup.sh shell: bash env: diff --git a/setup.sh b/setup.sh index 3d64ce7..bf7136f 100755 --- a/setup.sh +++ b/setup.sh @@ -7,12 +7,12 @@ fi echo "+ Create package.json file" echo '{"description": "","private": true,"version": "0.0.0","release":{}}' >package.json # shellcheck disable=SC2094 -cat <<<"$(jq --arg name "${GITHUB_REPOSITORY_NAME_PART}" '. += {name: $name}' package.json)" >package.json +cat <<<"$(jq --arg name "${RT_GITHUB_REPOSITORY_NAME_PART}" '. += {name: $name}' package.json)" >package.json if [ "${INPUT_DRYRUN}" == "true" ]; then echo "+ Setup current branch as releasable (dry-run mode)" # shellcheck disable=SC2094 - cat <<<"$(jq --arg branch "${GITHUB_REF_NAME}" '.release += {branches: [$branch]}' package.json)" >package.json + cat <<<"$(jq --arg branch "${RT_GITHUB_REF_NAME}" '.release += {branches: [$branch]}' package.json)" >package.json else echo "+ Setup releasable branches" # shellcheck disable=SC2094 From 1e6f4b56dd9f955e8ba26138e4ffb23456962577 Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Sat, 26 Oct 2024 22:31:10 +0200 Subject: [PATCH 3/6] feat(setup): add resilience in case of missing environment variables (#49) --- action.yml | 2 ++ setup.sh | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index c931661..158a0b7 100644 --- a/action.yml +++ b/action.yml @@ -63,6 +63,8 @@ runs: env: INPUT_DRYRUN: ${{ inputs.dry-run }} INPUT_WITHOUTPREFIX: ${{ inputs.without-prefix }} + REPOSITORY_NAME: ${{ env.RT_GITHUB_REPOSITORY_NAME_PART }} + REF_POINT: ${{ env.RT_GITHUB_REF_NAME }} - name: Semantic Release id: semantic-release uses: cycjimmy/semantic-release-action@v4 diff --git a/setup.sh b/setup.sh index bf7136f..062f8b5 100755 --- a/setup.sh +++ b/setup.sh @@ -4,23 +4,28 @@ if [ -z "$GITHUB_ACTION_PATH" ]; then GITHUB_ACTION_PATH=. fi -echo "+ Create package.json file" +echo "Create package.json file" echo '{"description": "","private": true,"version": "0.0.0","release":{}}' >package.json # shellcheck disable=SC2094 -cat <<<"$(jq --arg name "${RT_GITHUB_REPOSITORY_NAME_PART}" '. += {name: $name}' package.json)" >package.json +cat <<<"$(jq --arg name "${REPOSITORY_NAME}" '. += {name: $name}' package.json)" >package.json if [ "${INPUT_DRYRUN}" == "true" ]; then - echo "+ Setup current branch as releasable (dry-run mode)" - # shellcheck disable=SC2094 - cat <<<"$(jq --arg branch "${RT_GITHUB_REF_NAME}" '.release += {branches: [$branch]}' package.json)" >package.json + if [ -n "${REF_POINT}" ]; then + echo " - Setup current branch as releasable (dry-run mode)" + # shellcheck disable=SC2094 + cat <<<"$(jq --arg branch "${REF_POINT}" '.release += {branches: [$branch]}' package.json)" >package.json + else + echo " Fallback to releasable branches since not current branch is found (dry-run mode)" + cat <<<"$(jq --argjson branches "$(<"${GITHUB_ACTION_PATH}"/branches.json)" '.release += {branches: $branches}' package.json)" >package.json + fi else - echo "+ Setup releasable branches" + echo " - Setup releasable branches" # shellcheck disable=SC2094 cat <<<"$(jq --argjson branches "$(<"${GITHUB_ACTION_PATH}"/branches.json)" '.release += {branches: $branches}' package.json)" >package.json fi if [ "${INPUT_WITHOUTPREFIX}" == "true" ]; then - echo "+ Remove prefix from released version" + echo " - Remove prefix from released version" # shellcheck disable=SC2094 cat <<<"$(jq '.release += {tagFormat: "${version}"}' package.json)" >package.json fi From f3c7d7829effcf1e65dde9cfc864e55b6a91b2ef Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Sun, 27 Oct 2024 00:56:42 +0200 Subject: [PATCH 4/6] docs: improve community pages (#50) --- .github/ISSUE_TEMPLATE/bug_report.md | 23 ++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++ .github/workflows/linter.yaml | 1 + CONTRIBUTING.md | 33 +++++++++++++++++++++++ SECURITY.md | 22 +++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 CONTRIBUTING.md create mode 100644 SECURITY.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..37eab8f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..11fc491 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index c1950c4..664f69d 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -25,6 +25,7 @@ jobs: uses: github/super-linter@v7 env: VALIDATE_ALL_CODEBASE: false + VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_YAML_PRETTIER: false DEFAULT_BRANCH: v1.x GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a69233e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# How to contribute to Release That + +## Did you find a bug + +* **Do not open up a GitHub issue if the bug is a security vulnerability**, and instead to refer to our [security policy][1]. + +* **Ensure the bug was not already reported** by searching on GitHub under [Issues][2]. + +* If you're unable to find an open issue addressing the problem, [open a 'Bug' issue][4]. +Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. + +## Did you write a patch that fixes a bug + +* Open a new GitHub pull request with the patch. + +* Ensure the PR description clearly describes the problem and solution. +Include the relevant issue number if applicable. + +## Do you intend to add a new feature or change an existing one + +* Suggest your change by [opening a 'Feature request' issue][5] + +## Do you have questions about the source code + +* [open an issue][3] with your question. + +Thanks! + +[1]: https://github.com/rlespinasse/release-that/security/policy +[2]: https://github.com/rlespinasse/release-that/issues +[3]: https://github.com/rlespinasse/release-that/issues/new +[4]: https://github.com/rlespinasse/release-that/issues/new?assignees=&labels=bug&template=bug_report.md&title= +[5]: https://github.com/rlespinasse/release-that/issues/new?assignees=&labels=enhancement&template=feature_request.md&title= diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..99168a4 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,22 @@ +# Security Policy + +## Supported Versions and Branches + +| Version | Supported | End of Support | Branch | Specific Tags | +| ------- | ------------------ | -------------- | ------ | ------------- | +| 1.x | :white_check_mark: | | v1.x | v1 | + +A GitHub repository can use one of the available branches as an action inside its workflows. + +### End of Life of a branch + +Since `2024-10-26`, when a new major version is released, + +- The previous one will continue to receive security patches for 3 months, +- After the 3 months, the branch is deleted, and only the tags remain. + +## Reporting a Vulnerability + +In this project, you can report a Vulnerability by creating a [draft security advisory](https://github.com/rlespinasse/release-that/security/advisories). + +If the vulnerability is confirmed, a fix will be produced and the advisory will be published. From 187c1d28ae90eefb2f9a3b5b3592382742d5b427 Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Sun, 27 Oct 2024 01:11:10 +0200 Subject: [PATCH 5/6] ci: only run on branch for push triggered workflows (#51) Signed-off-by: Romain Lespinasse --- .github/workflows/release-that.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-that.yaml b/.github/workflows/release-that.yaml index 97d9fd8..6f3b0fb 100644 --- a/.github/workflows/release-that.yaml +++ b/.github/workflows/release-that.yaml @@ -1,5 +1,9 @@ name: Release that -on: [push, pull_request] +on: + push: + tags-ignore: + - .* + pull_request: permissions: read-all jobs: os-testing: From 207a9dd319e66140d9484ead459ef9937f15a22c Mon Sep 17 00:00:00 2001 From: Romain Lespinasse Date: Sun, 27 Oct 2024 01:21:27 +0200 Subject: [PATCH 6/6] ci: only run on branch for push triggered workflows (#52) Signed-off-by: Romain Lespinasse --- .github/workflows/release-that.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-that.yaml b/.github/workflows/release-that.yaml index 6f3b0fb..1f451d0 100644 --- a/.github/workflows/release-that.yaml +++ b/.github/workflows/release-that.yaml @@ -1,8 +1,10 @@ name: Release that on: push: + branches: + - "*" tags-ignore: - - .* + - "*" pull_request: permissions: read-all jobs: