diff --git a/.github/workflows/tagging.yaml b/.github/workflows/tagging.yaml index a36330d..526d705 100644 --- a/.github/workflows/tagging.yaml +++ b/.github/workflows/tagging.yaml @@ -9,7 +9,6 @@ on: - closed - reopened - synchronize - jobs: modified-version-files: runs-on: ubuntu-latest @@ -26,16 +25,17 @@ jobs: files: | resources/*/VERSION services/*/VERSION - + tag-modules: name: Create Git tag for modules with new versions runs-on: ubuntu-latest needs: [ modified-version-files ] permissions: contents: write + pull-requests: write strategy: matrix: - files: ${{ fromJSON(needs.modified-version-files.outputs.matrix) }} + file: ${{ fromJSON(needs.modified-version-files.outputs.matrix) }} max-parallel: 2 fail-fast: false steps: @@ -50,7 +50,7 @@ jobs: try { - const filename = '${{ matrix.files }}'; + const filename = '${{ matrix.file }}'; core.info(`Processing file "${filename}".`); const components = filename.split('/'); @@ -70,10 +70,11 @@ jobs: core.setOutput('module-type', moduleType); core.setOutput('tag', tag); core.setOutput('version', version); + } catch (err) { core.setFailed(`Action failed with error ${err}`); } - + # TODO: Check for existing tag - name: Create release id: create-release uses: actions/github-script@v7 @@ -81,18 +82,21 @@ jobs: with: script: | const sourceUrl = `git::ssh://git@github.com/${{ github.repository }}//${{ steps.parse-version-file.outputs.module-directory }}?ref=${{ steps.parse-version-file.outputs.tag }}` + const name = '${{ steps.parse-version-file.outputs.module-name }} ${{ steps.parse-version-file.outputs.version }}' const body = ` Version ${{ steps.parse-version-file.outputs.version }} of ${{ steps.parse-version-file.outputs.module-type }} module [${{ steps.parse-version-file.outputs.module-name }}](${{ steps.parse-version-file.outputs.module-directory }}). - To use this version of the module, set the \`source\` argument of the module call to \`${sourceUrl}\`. + To use this version of the module, set the \`source\` argument of the module call to the following value. + \`${sourceUrl}\`. - This release was generated for #${{ github.event.number }}'. + This release was generated for pull request #${{ github.event.number }}. ` github.rest.repos.createRelease({ body: body, - name: '${{ steps.parse-version-file.outputs.module-name }} ${{ steps.parse-version-file.outputs.version }}', + name: name, owner: context.repo.owner, repo: context.repo.repo, tag_name: '${{ steps.parse-version-file.outputs.tag }}', target_commitish: '${{ github.sha }}' }); + diff --git a/resources/module-b/VERSION b/resources/module-b/VERSION index afaf360..1cc5f65 100644 --- a/resources/module-b/VERSION +++ b/resources/module-b/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.1.0 \ No newline at end of file