This is an automated email from the ASF dual-hosted git repository. vy pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/logging-parent.git
The following commit(s) were added to refs/heads/main by this push: new 2487460 Reorganize placement of `env:` in workflows 2487460 is described below commit 248746079131d5c3c986ea4ee14435d1ca516553 Author: Volkan Yazıcı <vol...@yazi.ci> AuthorDate: Wed Apr 10 10:05:03 2024 +0200 Reorganize placement of `env:` in workflows --- .github/workflows/deploy-release-reusable.yaml | 28 +++++++++++------------- .github/workflows/deploy-snapshot-reusable.yaml | 8 +++---- .github/workflows/merge-dependabot-reusable.yaml | 22 +++++++++---------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.github/workflows/deploy-release-reusable.yaml b/.github/workflows/deploy-release-reusable.yaml index cd8ce16..2f6b156 100644 --- a/.github/workflows/deploy-release-reusable.yaml +++ b/.github/workflows/deploy-release-reusable.yaml @@ -83,6 +83,8 @@ jobs: - name: Export version shell: bash + env: + GIT_BRANCH_NAME: ${{ github.ref_name }} run: | [[ "$GIT_BRANCH_NAME" =~ ^release/.+$ ]] || { echo "was expecting a \`release/\`-prefixed Git branch name, found: \`$GIT_BRANCH_NAME\`" @@ -90,8 +92,6 @@ jobs: } export PROJECT_VERSION=$(echo "$GIT_BRANCH_NAME" | sed 's/^release\///') echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV - env: - GIT_BRANCH_NAME: ${{ github.ref_name }} - name: Set the Maven `revision` property shell: bash @@ -188,19 +188,22 @@ jobs: - name: Upload to Nexus shell: bash - run: | - ./mvnw \ - --show-version --batch-mode --errors --no-transfer-progress \ - -P deploy,release env: # `NEXUS_USERNAME` and `NEXUS_PASSWORD` are used in `~/.m2/settings.xml` created by `setup-java` action NEXUS_USERNAME: ${{ secrets.LOGGING_STAGE_DEPLOYER_USER }} NEXUS_PASSWORD: ${{ secrets.LOGGING_STAGE_DEPLOYER_PW }} # `SIGN_KEY` is used by `sign-maven-plugin` SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }} + run: | + ./mvnw \ + --show-version --batch-mode --errors --no-transfer-progress \ + -P deploy,release - name: Stage distribution attachments shell: bash + env: + DIST_ATTACHMENT_FILEPATH_PATTERN: ${{ inputs.distribution-attachment-filepath-pattern }} + DIST_ATTACHMENT_COUNT: ${{ inputs.distribution-attachment-count }} run: | # Determine the distribution attachment filepath pattern, if none provided @@ -228,10 +231,6 @@ jobs: DIST_ATTACHMENT_COUNT=$DIST_ATTACHMENT_COUNT EOF - env: - DIST_ATTACHMENT_FILEPATH_PATTERN: ${{ inputs.distribution-attachment-filepath-pattern }} - DIST_ATTACHMENT_COUNT: ${{ inputs.distribution-attachment-count }} - - name: Create the distribution shell: bash run: | @@ -272,6 +271,10 @@ jobs: - name: Upload to Subversion shell: bash + env: + PROJECT_ID: ${{ inputs.project-id }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} run: | # Find the effective Git commit ID @@ -312,8 +315,3 @@ jobs: --username "$SVN_USERNAME" \ --password "$SVN_PASSWORD" \ -m "Added \`${DIST_FILENAME_PREFIX}\` artifacts for release \`${PROJECT_VERSION}\`" - - env: - PROJECT_ID: ${{ inputs.project-id }} - SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} diff --git a/.github/workflows/deploy-snapshot-reusable.yaml b/.github/workflows/deploy-snapshot-reusable.yaml index 90cf26f..7fcab51 100644 --- a/.github/workflows/deploy-snapshot-reusable.yaml +++ b/.github/workflows/deploy-snapshot-reusable.yaml @@ -64,11 +64,11 @@ jobs: - name: Upload to Nexus shell: bash - run: | - ./mvnw \ - --show-version --batch-mode --errors --no-transfer-progress \ - -P deploy env: # `NEXUS_USERNAME` and `NEXUS_PASSWORD` are used in `~/.m2/settings.xml` created by `setup-java` action NEXUS_USERNAME: ${{ secrets.NEXUS_USER }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PW }} + run: | + ./mvnw \ + --show-version --batch-mode --errors --no-transfer-progress \ + -P deploy diff --git a/.github/workflows/merge-dependabot-reusable.yaml b/.github/workflows/merge-dependabot-reusable.yaml index 6ea36c3..25b736d 100644 --- a/.github/workflows/merge-dependabot-reusable.yaml +++ b/.github/workflows/merge-dependabot-reusable.yaml @@ -45,15 +45,15 @@ jobs: - name: Find dependency attributes shell: bash + env: + DEPENDENCY_NAMES: ${{ steps.dependabot-metadata.outputs.dependency-names }} + DEPENDENCY_VERSION: ${{ steps.dependabot-metadata.outputs.new-version }} run: | DEPENDENCY_NAME=$(echo "$DEPENDENCY_NAMES" | tr "," '\n' | head -n 1) cat >> $GITHUB_ENV << EOF DEPENDENCY_NAME=$DEPENDENCY_NAME DEPENDENCY_VERSION=$DEPENDENCY_VERSION EOF - env: - DEPENDENCY_NAMES: ${{ steps.dependabot-metadata.outputs.dependency-names }} - DEPENDENCY_VERSION: ${{ steps.dependabot-metadata.outputs.new-version }} - name: Checkout repository uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # 4.1.2 @@ -62,10 +62,10 @@ jobs: - name: Download and apply patch shell: bash - run: | - wget -O- "$PATCH_URL" | git apply env: PATCH_URL: ${{ github.event.pull_request.patch_url }} + run: | + wget -O- "$PATCH_URL" | git apply - name: Set up Java & GPG uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # 4.2.1 @@ -93,6 +93,9 @@ jobs: - name: Create changelog entry shell: bash + env: + PR_URL: ${{ github.event.pull_request.html_url }} + PR_ID: ${{ github.event.pull_request.number }} run: | if [ -d "src/changelog" ]; then RELEASE_CHANGELOG_FILEPATH="src/changelog/.${RELEASE_VERSION_MAJOR}.x.x" @@ -110,9 +113,6 @@ jobs: </entry> EOF fi - env: - PR_URL: ${{ github.event.pull_request.html_url }} - PR_ID: ${{ github.event.pull_request.number }} - name: Generate sources shell: bash @@ -123,6 +123,9 @@ jobs: - name: Add & commit changes shell: bash + env: + PR_ID: ${{ github.event.pull_request.number }} + PR_BRANCH: ${{ github.head_ref }} run: | git add . git config user.name "ASF Logging Services RM" @@ -131,6 +134,3 @@ jobs: git push origin # Pushing the same commit to the Dependebot branch closes the PR git push -f origin "HEAD:$PR_BRANCH" - env: - PR_ID: ${{ github.event.pull_request.number }} - PR_BRANCH: ${{ github.head_ref }}