ppkarwasz commented on code in PR #419: URL: https://github.com/apache/logging-parent/pull/419#discussion_r2163708137
########## .github/workflows/process-dependabot-reusable.yaml: ########## @@ -0,0 +1,171 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Dependabot Process PR + +on: + workflow_call: + inputs: + user-name: + description: The name of the user to use for the commit + default: 'ASF Logging Services RM' + type: string + user-email: + description: The email of the user to use for the commit + default: '[email protected]' + type: string + analyze-workflow-run-id: + description: The ID of the workflow run that analyzed the PR + required: true + type: number + secrets: + AUTO_MERGE_TOKEN: + description: GitHub token to enable auto-merge on PR + required: true + CONTENT_WRITE_TOKEN: + description: GitHub token to push changes + required: true + GPG_PASSPHRASE: + description: GPG passphrase for signing commits + required: false + GPG_PRIVATE_KEY: + description: GPG secret key for signing commits + required: true + +jobs: + + generate-changelog: + # Skip this workflow on commits not pushed by Dependabot + if: ${{ github.actor == 'dependabot[bot]' }} + runs-on: ubuntu-latest + + steps: + + - name: Fetch Dependabot metadata + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # 4.3.0 + with: + github-token: ${{ github.token }} + name: dependabot-metadata + path: ${{ runner.temp }}/dependabot-metadata + run-id: ${{ inputs.analyze-workflow-run-id }} + + - name: Process Dependabot metadata + shell: bash + run: | + # Extract the pull request metadata from the downloaded artifact + path="$RUNNER_TEMP/dependabot-metadata" + if [[ ! -f "$path/pull_request.json" ]]; then + echo "Pull request metadata not found at $path/pull_request.json" + exit 1 + fi + if [[ ! -f "$path/updated_dependencies.json" ]]; then + echo "Updated dependencies metadata not found at $path/updated_dependencies.json" + exit 1 + fi + # Extract the required metadata and set it as environment variables + pull_request="$path/pull_request.json" + echo "PR_ID=$(jq -r '.number' < "$pull_request")" >> $GITHUB_ENV + echo "PR_URL=$(jq -r '.html_url' < "$pull_request")" >> $GITHUB_ENV + echo "PR_HEAD_REF=$(jq -r '.head.ref' < "$pull_request")" >> $GITHUB_ENV + + - name: Check out repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 Review Comment: Thank you, but I'll pass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
