Fix auto-update action (#7804)
so it doesn't keep trying to open new PRs while existing PR is open
This commit is contained in:
parent
8e8161cb2e
commit
ee722f9a4a
|
@ -12,6 +12,7 @@ jobs:
|
|||
outputs:
|
||||
current-version: ${{ steps.check-versions.outputs.current-version }}
|
||||
latest-version: ${{ steps.check-versions.outputs.latest-version }}
|
||||
already-opened: ${{ steps.check-versions.outputs.already-opened }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
@ -28,12 +29,24 @@ jobs:
|
|||
--jq .tagName \
|
||||
| sed 's/^v//')
|
||||
|
||||
matches=$(gh pr list \
|
||||
--author opentelemetrybot \
|
||||
--state open \
|
||||
--search "in:title \"Update the OpenTelemetry SDK version to $latest_version\"")
|
||||
if [ ! -z "$matches" ]
|
||||
then
|
||||
already_opened=true
|
||||
fi
|
||||
|
||||
echo "current-version=$current_version" >> $GITHUB_OUTPUT
|
||||
echo "latest-version=$latest_version" >> $GITHUB_OUTPUT
|
||||
echo "already-opened=$already_opened" >> $GITHUB_OUTPUT
|
||||
|
||||
update-otel-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version
|
||||
if: |
|
||||
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&
|
||||
needs.check-versions.outputs.already-opened != 'true'
|
||||
needs:
|
||||
- check-versions
|
||||
steps:
|
||||
|
@ -56,7 +69,7 @@ jobs:
|
|||
env:
|
||||
VERSION: ${{ needs.check-versions.outputs.latest-version }}
|
||||
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
|
||||
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
|
||||
run: |
|
||||
message="Update the OpenTelemetry SDK version to $VERSION"
|
||||
body="Update the OpenTelemetry SDK version to \`$VERSION\`."
|
||||
|
|
Loading…
Reference in New Issue