diff --git a/.github/workflows/test-and-build.yaml b/.github/workflows/test-and-build.yaml index 42d41134..1fb0fc5e 100644 --- a/.github/workflows/test-and-build.yaml +++ b/.github/workflows/test-and-build.yaml @@ -96,13 +96,16 @@ jobs: steps: - name: Call workflow uses: actions/github-script@v7 + env: + INTEGRATION_TEST_REPO: ${{ secrets.INTEGRATION_TEST_REPO }} + INTEGRATION_TEST_WORKFLOW: "${{ secrets.INTEGRATION_TEST_WORKFLOW }}.yaml" with: github-token: ${{ secrets.INTEGRATION_TEST_PAT }} script: | await github.rest.actions.createWorkflowDispatch({ owner: 'statisticsnorway', - repo: '${{ secrets.INTEGRATION_TEST_REPO }}', - workflow_id: '${{ secrets.INTEGRATION_TEST_WORKFLOW }}.yaml', + repo: process.env.INTEGRATION_TEST_REPO, + workflow_id: process.env.INTEGRATION_TEST_WORKFLOW, ref: 'main' }) @@ -137,13 +140,16 @@ jobs: steps: - name: Call workflow uses: actions/github-script@v7 + env: + DEPLOY_REPO: ${{ secrets.DEPLOY_REPO }} + DEPLOY_WORKFLOW: "${{ secrets.DEPLOY_WORKFLOW }}.yaml" with: github-token: ${{ secrets.DEPLOY_PAT }} script: | await github.rest.actions.createWorkflowDispatch({ owner: 'statisticsnorway', - repo: '${{ secrets.DEPLOY_REPO }}', - workflow_id: '${{ secrets.DEPLOY_WORKFLOW }}.yaml', + repo: process.env.DEPLOY_REPO, + workflow_id: process.env.DEPLOY_WORKFLOW, ref: 'master', inputs: { environment: "PROD", diff --git a/.github/workflows/update-tools-version.yaml b/.github/workflows/update-tools-version.yaml index 6fc33277..88658e38 100644 --- a/.github/workflows/update-tools-version.yaml +++ b/.github/workflows/update-tools-version.yaml @@ -46,24 +46,28 @@ jobs: - name: Update Microdata Tools Dependency if: steps.check_version.outputs.new_version + env: + NEW_VERSION: ${{ steps.check_version.outputs.new_version }} run: | git config --global user.name 'github-actions' git config --global user.email 'github-actions@github.com' git pull origin main - git checkout -b bump-microdata-tools-${{ steps.check_version.outputs.new_version }} - uv add 'microdata-tools==${{ steps.check_version.outputs.new_version }}' + git checkout -b "bump-microdata-tools-$NEW_VERSION" + uv add "microdata-tools==$NEW_VERSION" git add pyproject.toml uv.lock - git commit -m "Update microdata-tools to ${{ steps.check_version.outputs.new_version }}" - git push origin bump-microdata-tools-${{ steps.check_version.outputs.new_version }} + git commit -m "Update microdata-tools to $NEW_VERSION" + git push origin "bump-microdata-tools-$NEW_VERSION" - name: Create Pull Request if: steps.check_version.outputs.new_version + env: + NEW_VERSION: ${{ steps.check_version.outputs.new_version }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh pr create \ --base main \ - --head bump-microdata-tools-${{ steps.check_version.outputs.new_version }} \ - --title "Update microdata-tools to ${{ steps.check_version.outputs.new_version }}" \ - --body "This PR updates microdata-tools to version ${{ steps.check_version.outputs.new_version }}." + --head "bump-microdata-tools-$NEW_VERSION" \ + --title "Update microdata-tools to $NEW_VERSION" \ + --body "This PR updates microdata-tools to version $NEW_VERSION." # --reviewer statisticsnorway/microdata-developers # Reviwer not found [should work according to docs](https://cli.github.com/manual/gh_pr_create) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +