diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..afb98ae --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 065d116..0af8f49 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -16,7 +16,7 @@ jobs: github.actor == 'renovate' steps: - name: automerge - uses: pascalgn/automerge-action@v0.14.3 + uses: pascalgn/automerge-action@v0.15.3 env: GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} MERGE_METHOD: "rebase" diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index f10cd57..a34b1e0 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -44,6 +44,6 @@ jobs: # Upload the SARIF file generated in the previous step - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v2 with: sarif_file: results.sarif diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 07166b8..c60994b 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -13,6 +13,6 @@ jobs: token: ${{ secrets.PAT_TOKEN }} fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - name: Automatic Rebase - uses: cirrus-actions/rebase@1.5 + uses: cirrus-actions/rebase@1.7 env: GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/sync-release-version.yml b/.github/workflows/sync-release-version.yml index 0f45377..1e94280 100644 --- a/.github/workflows/sync-release-version.yml +++ b/.github/workflows/sync-release-version.yml @@ -12,7 +12,7 @@ jobs: with: fetch-depth: 0 - name: Sync release version - uses: tj-actions/sync-release-version@v8.7 + uses: tj-actions/sync-release-version@v11 id: sync-release-version with: pattern: '${{ github.repository }}@' @@ -23,7 +23,7 @@ jobs: with: output: 'HISTORY.md' - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: base: "main" title: "Upgraded to ${{ steps.sync-release-version.outputs.new_version }}" diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index ba9aef3..e8286d1 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -9,12 +9,12 @@ jobs: sync-assets: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.0.0 + - uses: actions/checkout@v3.0.2 with: fetch-depth: 0 - name: Run test - uses: tj-actions/remark@v2.3 + uses: tj-actions/remark@v3 - name: Verify Changed files uses: tj-actions/verify-changed-files@v9 @@ -29,7 +29,7 @@ jobs: exit 1 - name: Create Pull Request if: failure() - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: base: "main" title: "Updated README.md" diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 099db99..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM alpine:3.15.1 - -LABEL maintainer="Tonye Jack " - -RUN apk add wget bash git openssh grep sed - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/HISTORY.md b/HISTORY.md index bff4b08..98eb2fa 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,46 @@ # Changelog +## [v1.2.1](https://github.com/tj-actions/semver-diff/tree/v1.2.1) (2022-03-23) + +[Full Changelog](https://github.com/tj-actions/semver-diff/compare/v1.2.0...v1.2.1) + +**Closed issues:** + +- Dependency Dashboard [\#3](https://github.com/tj-actions/semver-diff/issues/3) + +**Merged pull requests:** + +- Update dependency alpine to v3.15.1 [\#39](https://github.com/tj-actions/semver-diff/pull/39) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/github-changelog-generator action to v1.13 [\#38](https://github.com/tj-actions/semver-diff/pull/38) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/verify-changed-files action to v9 [\#37](https://github.com/tj-actions/semver-diff/pull/37) ([renovate[bot]](https://github.com/apps/renovate)) +- Update codacy/codacy-analysis-cli-action action to v4.0.2 [\#36](https://github.com/tj-actions/semver-diff/pull/36) ([renovate[bot]](https://github.com/apps/renovate)) +- Update codacy/codacy-analysis-cli-action action to v4.0.1 [\#35](https://github.com/tj-actions/semver-diff/pull/35) ([renovate[bot]](https://github.com/apps/renovate)) +- Update actions/checkout action [\#34](https://github.com/tj-actions/semver-diff/pull/34) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/github-changelog-generator action to v1.12 [\#33](https://github.com/tj-actions/semver-diff/pull/33) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/remark action to v2.3 [\#32](https://github.com/tj-actions/semver-diff/pull/32) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/remark action to v2 [\#31](https://github.com/tj-actions/semver-diff/pull/31) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/github-changelog-generator action to v1.11 [\#30](https://github.com/tj-actions/semver-diff/pull/30) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/github-changelog-generator action to v1.10 [\#29](https://github.com/tj-actions/semver-diff/pull/29) ([renovate[bot]](https://github.com/apps/renovate)) +- Update alpine Docker tag to v3.15.0 [\#28](https://github.com/tj-actions/semver-diff/pull/28) ([renovate[bot]](https://github.com/apps/renovate)) +- Update alpine Docker tag to v3.14.3 [\#27](https://github.com/tj-actions/semver-diff/pull/27) ([renovate[bot]](https://github.com/apps/renovate)) +- Updated README.md [\#26](https://github.com/tj-actions/semver-diff/pull/26) ([jackton1](https://github.com/jackton1)) +- Update actions/checkout action to v2.4.0 [\#25](https://github.com/tj-actions/semver-diff/pull/25) ([renovate[bot]](https://github.com/apps/renovate)) +- Update actions/checkout action to v2.3.5 [\#24](https://github.com/tj-actions/semver-diff/pull/24) ([renovate[bot]](https://github.com/apps/renovate)) +- Updated README.md [\#23](https://github.com/tj-actions/semver-diff/pull/23) ([jackton1](https://github.com/jackton1)) +- Update tj-actions/verify-changed-files action to v8 [\#22](https://github.com/tj-actions/semver-diff/pull/22) ([renovate[bot]](https://github.com/apps/renovate)) +- Update pascalgn/automerge-action action to v0.14.3 [\#21](https://github.com/tj-actions/semver-diff/pull/21) ([renovate[bot]](https://github.com/apps/renovate)) +- Update alpine Docker tag to v3.14.2 [\#20](https://github.com/tj-actions/semver-diff/pull/20) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/remark action to v1.7 [\#19](https://github.com/tj-actions/semver-diff/pull/19) ([renovate[bot]](https://github.com/apps/renovate)) +- Update alpine Docker tag to v3.14.1 [\#18](https://github.com/tj-actions/semver-diff/pull/18) ([renovate[bot]](https://github.com/apps/renovate)) +- Update codacy/codacy-analysis-cli-action action to v4 [\#17](https://github.com/tj-actions/semver-diff/pull/17) ([renovate[bot]](https://github.com/apps/renovate)) +- Updated README.md [\#16](https://github.com/tj-actions/semver-diff/pull/16) ([jackton1](https://github.com/jackton1)) +- Update codacy/codacy-analysis-cli-action action to v3 [\#15](https://github.com/tj-actions/semver-diff/pull/15) ([renovate[bot]](https://github.com/apps/renovate)) +- Update tj-actions/verify-changed-files action to v7 [\#13](https://github.com/tj-actions/semver-diff/pull/13) ([renovate[bot]](https://github.com/apps/renovate)) +- Update alpine Docker tag to v3.14.0 [\#12](https://github.com/tj-actions/semver-diff/pull/12) ([renovate[bot]](https://github.com/apps/renovate)) +- Updated README.md [\#11](https://github.com/tj-actions/semver-diff/pull/11) ([jackton1](https://github.com/jackton1)) +- Update tj-actions/sync-release-version action to v8.7 [\#10](https://github.com/tj-actions/semver-diff/pull/10) ([renovate[bot]](https://github.com/apps/renovate)) +- Upgraded to v1.2.0 [\#8](https://github.com/tj-actions/semver-diff/pull/8) ([jackton1](https://github.com/jackton1)) + ## [v1.2.0](https://github.com/tj-actions/semver-diff/tree/v1.2.0) (2021-05-24) [Full Changelog](https://github.com/tj-actions/semver-diff/compare/v1.1.3...v1.2.0) @@ -25,10 +66,6 @@ [Full Changelog](https://github.com/tj-actions/semver-diff/compare/v1...v1.1) -**Closed issues:** - -- Dependency Dashboard [\#3](https://github.com/tj-actions/semver-diff/issues/3) - **Merged pull requests:** - Upgraded to v1 [\#4](https://github.com/tj-actions/semver-diff/pull/4) ([jackton1](https://github.com/jackton1)) diff --git a/README.md b/README.md index 02e2118..a6399b0 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v2 - name: Run semver-diff id: semver-diff - uses: tj-actions/semver-diff@v1.2.0 + uses: tj-actions/semver-diff@v1.2.1 - name: Show release type run: | echo "Release type: ${{ steps.semver-diff.outputs.release_type }}" @@ -57,7 +57,7 @@ jobs: - name: Run semver-diff id: semver-diff - uses: tj-actions/semver-diff@v1.2.0 + uses: tj-actions/semver-diff@v1.2.1 - name: Set up Python uses: actions/setup-python@v2 diff --git a/action.yml b/action.yml index 9e44801..94dbbc4 100644 --- a/action.yml +++ b/action.yml @@ -14,14 +14,31 @@ inputs: outputs: release_type: description: 'The difference between two versions by the release type (major, minor, patch, prerelease, build)' + value: ${{ steps.semver.outputs.release_type }} new_version: description: 'The current project version' + value: ${{ steps.semver.outputs.new_version }} old_version: description: 'The previous project version' + value: ${{ steps.semver.outputs.old_version }} runs: - using: 'docker' - image: 'Dockerfile' + using: 'composite' + steps: + - run: | + bash $GITHUB_ACTION_PATH/entrypoint.sh + id: semver + shell: bash + env: + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_REF: ${{ github.ref }} + GITHUB_EVENT_NAME: ${{ github.event_name }} + # INPUT_ is not available in Composite run steps + # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 + INPUT_TOKEN: ${{ inputs.token }} + INPUT_INITIAL_RELEASE_TYPE: ${{ inputs.initial_release_type }} + branding: icon: copy color: white diff --git a/entrypoint.sh b/entrypoint.sh index b8ff532..0109072 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,8 +7,6 @@ if [[ $GITHUB_REF != "refs/tags/"* ]]; then exit 0; fi -git remote set-url origin "https://$INPUT_TOKEN@github.com/$GITHUB_REPOSITORY" - git fetch origin +refs/tags/*:refs/tags/* CURRENT_TAG=${3:-$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)" || true)} @@ -21,6 +19,7 @@ if [[ -z $CURRENT_TAG ]]; then exit 0; fi +echo "::debug::Calculating diff..." PART=$(wget -O - https://raw.githubusercontent.com/fsaintjacques/semver-tool/3.2.0/src/semver | bash -s diff "${CURRENT_TAG//v/}" "${NEW_TAG//v/}") echo "::set-output name=release_type::$PART"