From 7da3c29a54bd6ff79cd39d60827451084adc6b00 Mon Sep 17 00:00:00 2001 From: Rishav Dhar <19497993+rdhar@users.noreply.github.com> Date: Mon, 17 Mar 2025 15:27:54 +0000 Subject: [PATCH 1/5] docs: rename gh action Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> --- .github/workflows/test_ci.yaml | 35 ++++++++++++++++++++++++++++++++++ README.md | 22 ++++++++++----------- SECURITY.md | 2 +- action.yml | 15 ++++++++++++--- 4 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/test_ci.yaml diff --git a/.github/workflows/test_ci.yaml b/.github/workflows/test_ci.yaml new file mode 100644 index 0000000..8455441 --- /dev/null +++ b/.github/workflows/test_ci.yaml @@ -0,0 +1,35 @@ +--- +name: Test CI + +on: + pull_request: + paths: [.github/workflows/test_ci.yaml, action.yml] + +jobs: + ci: + runs-on: ubuntu-24.04 + + permissions: + contents: read # Required to checkout repository. + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Changed diff-tree + id: changed + uses: ./ + with: + working-directory: tests/${{ matrix.test }} + + - name: Tag release version + env: + GH_TOKEN: ${{ github.token }} + GH_TAG: ${{ github.event.release.tag_name}} + run: | + version=${GH_TAG%%.*} + gh api /repos/${{ github.repository }}/git/refs/tags/${version} --method PATCH --silent --field sha="${GITHUB_SHA}" --field force=true || \ + gh api /repos/${{ github.repository }}/git/refs --method POST --silent --field sha="${GITHUB_SHA}" --field ref="refs/tags/${version}" diff --git a/README.md b/README.md index a7e9ee4..2996267 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -[![GitHub license](https://img.shields.io/github/license/op5dev/diff-tree?logo=apache&label=License)](LICENSE "Apache License 2.0.") -[![GitHub release tag](https://img.shields.io/github/v/release/op5dev/diff-tree?logo=semanticrelease&label=Release)](https://github.com/op5dev/diff-tree/releases "View all releases.") +[![GitHub license](https://img.shields.io/github/license/op5dev/changed-diff-tree?logo=apache&label=License)](LICENSE "Apache License 2.0.") +[![GitHub release tag](https://img.shields.io/github/v/release/op5dev/changed-diff-tree?logo=semanticrelease&label=Release)](https://github.com/op5dev/changed-diff-tree/releases "View all releases.") * -[![GitHub repository stargazers](https://img.shields.io/github/stars/op5dev/diff-tree)](https://github.com/op5dev/diff-tree "Become a stargazer.") +[![GitHub repository stargazers](https://img.shields.io/github/stars/op5dev/changed-diff-tree)](https://github.com/op5dev/changed-diff-tree "Become a stargazer.") -# Diff-Tree +# Changed Diff-Tree -Git diff-tree for a list of changed files or directories between commits for GitHub Action event triggers. +Git diff-tree for a list of changed files or directories between branches with GitHub Action event triggers. ## Parameters @@ -33,21 +33,21 @@ View [security policy and reporting instructions](SECURITY.md). ## Changelog -View [all notable changes](https://github.com/op5dev/diff-tree/releases "Releases.") to this project in [Keep a Changelog](https://keepachangelog.com "Keep a Changelog.") format, which adheres to [Semantic Versioning](https://semver.org "Semantic Versioning."). +View [all notable changes](https://github.com/op5dev/changed-diff-tree/releases "Releases.") to this project in [Keep a Changelog](https://keepachangelog.com "Keep a Changelog.") format, which adheres to [Semantic Versioning](https://semver.org "Semantic Versioning."). > [!TIP] > > All forms of **contribution are very welcome** and deeply appreciated for fostering open-source projects. > -> - [Create a PR](https://github.com/op5dev/diff-tree/pulls "Create a pull request.") to contribute changes you'd like to see. -> - [Raise an issue](https://github.com/op5dev/diff-tree/issues "Raise an issue.") to propose changes or report unexpected behavior. -> - [Open a discussion](https://github.com/op5dev/diff-tree/discussions "Open a discussion.") to discuss broader topics or questions. -> - [Become a stargazer](https://github.com/op5dev/diff-tree/stargazers "Become a stargazer.") if you find this project useful. +> - [Create a PR](https://github.com/op5dev/changed-diff-tree/pulls "Create a pull request.") to contribute changes you'd like to see. +> - [Raise an issue](https://github.com/op5dev/changed-diff-tree/issues "Raise an issue.") to propose changes or report unexpected behavior. +> - [Open a discussion](https://github.com/op5dev/changed-diff-tree/discussions "Open a discussion.") to discuss broader topics or questions. +> - [Become a stargazer](https://github.com/op5dev/changed-diff-tree/stargazers "Become a stargazer.") if you find this project useful.
## License - This project is licensed under the permissive [Apache License 2.0](LICENSE "Apache License 2.0."). -- All works herein are my own, shared of my own volition, and [contributors](https://github.com/op5dev/diff-tree/graphs/contributors "Contributors."). +- All works herein are my own, shared of my own volition, and [contributors](https://github.com/op5dev/changed-diff-tree/graphs/contributors "Contributors."). - Copyright 2016-present [Rishav Dhar](https://github.com/rdhar "Rishav Dhar's GitHub profile.") — All wrongs reserved. diff --git a/SECURITY.md b/SECURITY.md index bc7ac54..9ab5818 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,4 +11,4 @@ Integrating security in your CI/CD pipeline is critical to practicing DevSecOps. ## Reporting a Vulnerability -You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead, sensitive bugs must be sent by email to or reported via [Security Advisory](https://github.com/op5dev/diff-tree/security/advisories/new "Create a new security advisory."). +You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead, sensitive bugs must be sent by email to or reported via [Security Advisory](https://github.com/op5dev/changed-diff-tree/security/advisories/new "Create a new security advisory."). diff --git a/action.yml b/action.yml index c9827aa..028424e 100644 --- a/action.yml +++ b/action.yml @@ -1,7 +1,7 @@ --- name: Git Diff-Tree for Changed Files or Directories author: Rishav Dhar (@rdhar) -description: Git diff-tree for a list of changed files or directories between commits for GitHub Action event triggers. +description: Git diff-tree for a list of changed files or directories between branches with GitHub Action event triggers. runs: using: composite @@ -28,10 +28,19 @@ outputs: value: placeholder inputs: + source_ref: + required: false + description: "Source branch or commit SHA to compare from." + target_ref: + required: false + description: "Target branch or commit SHA to compare against." + format: + required: false + description: "Format output as: 'raw', 'json', or 'matrix'." token: required: true description: "GitHub access token with 'read:org' scope (e.g., secrets.CI_PAT)." branding: - color: green - icon: user-check + color: gray-dark + icon: file-plus From 248900ef664aaa82ae74c253b8d403f65ba314a1 Mon Sep 17 00:00:00 2001 From: Rishav Dhar <19497993+rdhar@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:10:56 +0000 Subject: [PATCH 2/5] notes Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> --- README.md | 4 +++- action.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2996267..5856541 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,12 @@ * [![GitHub repository stargazers](https://img.shields.io/github/stars/op5dev/changed-diff-tree)](https://github.com/op5dev/changed-diff-tree "Become a stargazer.") -# Changed Diff-Tree +# Changed Diff-Tree ± Git diff-tree for a list of changed files or directories between branches with GitHub Action event triggers. +TODO: https://github.com/orgs/community/discussions/25950 + ## Parameters ### Inputs diff --git a/action.yml b/action.yml index 028424e..5b27865 100644 --- a/action.yml +++ b/action.yml @@ -37,9 +37,11 @@ inputs: format: required: false description: "Format output as: 'raw', 'json', or 'matrix'." + default: "raw" token: required: true description: "GitHub access token with 'read:org' scope (e.g., secrets.CI_PAT)." + default: ${{ secrets.GITHUB_TOKEN }} branding: color: gray-dark From ad18b7d217638f08291587ebd0c7daa90f3e4270 Mon Sep 17 00:00:00 2001 From: Rishav Dhar <19497993+rdhar@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:18:02 +0000 Subject: [PATCH 3/5] sanity Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> --- .github/workflows/test_ci.yaml | 11 ----------- action.yml | 2 ++ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test_ci.yaml b/.github/workflows/test_ci.yaml index 8455441..4ae09b1 100644 --- a/.github/workflows/test_ci.yaml +++ b/.github/workflows/test_ci.yaml @@ -22,14 +22,3 @@ jobs: - name: Changed diff-tree id: changed uses: ./ - with: - working-directory: tests/${{ matrix.test }} - - - name: Tag release version - env: - GH_TOKEN: ${{ github.token }} - GH_TAG: ${{ github.event.release.tag_name}} - run: | - version=${GH_TAG%%.*} - gh api /repos/${{ github.repository }}/git/refs/tags/${version} --method PATCH --silent --field sha="${GITHUB_SHA}" --field force=true || \ - gh api /repos/${{ github.repository }}/git/refs --method POST --silent --field sha="${GITHUB_SHA}" --field ref="refs/tags/${version}" diff --git a/action.yml b/action.yml index 5b27865..d18d460 100644 --- a/action.yml +++ b/action.yml @@ -31,9 +31,11 @@ inputs: source_ref: required: false description: "Source branch or commit SHA to compare from." + default: "" target_ref: required: false description: "Target branch or commit SHA to compare against." + default: "" format: required: false description: "Format output as: 'raw', 'json', or 'matrix'." From 7800ae71f48cdf23982879cb762b5c787a2da580 Mon Sep 17 00:00:00 2001 From: Rishav Dhar <19497993+rdhar@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:20:29 +0000 Subject: [PATCH 4/5] fix default input Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> --- action.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index d18d460..c03a64f 100644 --- a/action.yml +++ b/action.yml @@ -29,21 +29,21 @@ outputs: inputs: source_ref: - required: false - description: "Source branch or commit SHA to compare from." default: "" - target_ref: + description: "Source branch or commit SHA to compare from." required: false - description: "Target branch or commit SHA to compare against." + target_ref: default: "" - format: + description: "Target branch or commit SHA to compare against." required: false - description: "Format output as: 'raw', 'json', or 'matrix'." + format: default: "raw" + description: "Format output as: 'raw', 'json', or 'matrix'." + required: false token: - required: true + default: ${{ github.token }} description: "GitHub access token with 'read:org' scope (e.g., secrets.CI_PAT)." - default: ${{ secrets.GITHUB_TOKEN }} + required: true branding: color: gray-dark From 3a6003eb69cf8e53a9aa2b3d0a7bac835bebdb78 Mon Sep 17 00:00:00 2001 From: Rishav Dhar <19497993+rdhar@users.noreply.github.com> Date: Tue, 18 Mar 2025 02:02:43 +0000 Subject: [PATCH 5/5] gha description Signed-off-by: Rishav Dhar <19497993+rdhar@users.noreply.github.com> --- README.md | 2 +- action.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5856541..35471f2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # Changed Diff-Tree ± -Git diff-tree for a list of changed files or directories between branches with GitHub Action event triggers. +Changed diff-tree for a list of changed files or directories between branches with GitHub Action event triggers TODO: https://github.com/orgs/community/discussions/25950 diff --git a/action.yml b/action.yml index c03a64f..f052c0b 100644 --- a/action.yml +++ b/action.yml @@ -1,7 +1,7 @@ --- -name: Git Diff-Tree for Changed Files or Directories +name: Changed Diff-Tree for Files or Directories author: Rishav Dhar (@rdhar) -description: Git diff-tree for a list of changed files or directories between branches with GitHub Action event triggers. +description: Changed diff-tree for a list of changed files or directories between branches with GitHub Action event triggers. runs: using: composite