dependabot[bot] abdb4941c6
chore(deps): bump the github-actions group with 20 updates (#1907)
Bumps the github-actions group with 20 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `2` | `4` |
| [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) | `3` | `4` |
| [actions/github-script](https://github.com/actions/github-script) | `6` | `7` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `5.0.0` | `5.5.1` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `3` | `4` |
| [github/codeql-action](https://github.com/github/codeql-action) | `2` | `3` |
| [ad-m/github-push-action](https://github.com/ad-m/github-push-action) | `0.6.0` | `0.8.0` |
| [actions/dependency-review-action](https://github.com/actions/dependency-review-action) | `3` | `4` |
| [actions/cache](https://github.com/actions/cache) | `3` | `4` |
| [actions/setup-go](https://github.com/actions/setup-go) | `4` | `5` |
| [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) | `3.7.0` | `4.0.0` |
| [actions/first-interaction](https://github.com/actions/first-interaction) | `1.2.0` | `1.3.0` |
| [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) | `1.8.0` | `1.9.3` |
| [peter-evans/create-issue-from-file](https://github.com/peter-evans/create-issue-from-file) | `4` | `5` |
| [dessant/lock-threads](https://github.com/dessant/lock-threads) | `4` | `5` |
| [actions/setup-node](https://github.com/actions/setup-node) | `2` | `4` |
| [alex-page/github-project-automation-plus](https://github.com/alex-page/github-project-automation-plus) | `0.8.3` | `0.9.0` |
| [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | `5` | `6` |
| [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) | `5` | `6` |
| [actions/stale](https://github.com/actions/stale) | `8` | `9` |


Updates `actions/checkout` from 2 to 4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

Updates `peter-evans/create-or-update-comment` from 3 to 4
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](https://github.com/peter-evans/create-or-update-comment/compare/v3...v4)

Updates `actions/github-script` from 6 to 7
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

Updates `docker/metadata-action` from 5.0.0 to 5.5.1
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v5.0.0...v5.5.1)

Updates `codecov/codecov-action` from 3 to 4
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

Updates `github/codeql-action` from 2 to 3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

Updates `ad-m/github-push-action` from 0.6.0 to 0.8.0
- [Release notes](https://github.com/ad-m/github-push-action/releases)
- [Commits](https://github.com/ad-m/github-push-action/compare/v0.6.0...v0.8.0)

Updates `actions/dependency-review-action` from 3 to 4
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/v3...v4)

Updates `actions/cache` from 3 to 4
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

Updates `actions/setup-go` from 4 to 5
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

Updates `golangci/golangci-lint-action` from 3.7.0 to 4.0.0
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.7.0...v4.0.0)

Updates `actions/first-interaction` from 1.2.0 to 1.3.0
- [Release notes](https://github.com/actions/first-interaction/releases)
- [Commits](https://github.com/actions/first-interaction/compare/v1.2.0...v1.3.0)

Updates `lycheeverse/lychee-action` from 1.8.0 to 1.9.3
- [Release notes](https://github.com/lycheeverse/lychee-action/releases)
- [Commits](https://github.com/lycheeverse/lychee-action/compare/v1.8.0...v1.9.3)

Updates `peter-evans/create-issue-from-file` from 4 to 5
- [Release notes](https://github.com/peter-evans/create-issue-from-file/releases)
- [Commits](https://github.com/peter-evans/create-issue-from-file/compare/v4...v5)

Updates `dessant/lock-threads` from 4 to 5
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v4...v5)

Updates `actions/setup-node` from 2 to 4
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2...v4)

Updates `alex-page/github-project-automation-plus` from 0.8.3 to 0.9.0
- [Release notes](https://github.com/alex-page/github-project-automation-plus/releases)
- [Commits](https://github.com/alex-page/github-project-automation-plus/compare/v0.8.3...v0.9.0)

Updates `peter-evans/create-pull-request` from 5 to 6
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6)

Updates `release-drafter/release-drafter` from 5 to 6
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6)

Updates `actions/stale` from 8 to 9
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: peter-evans/create-or-update-comment
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: ad-m/github-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/first-interaction
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: lycheeverse/lychee-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: peter-evans/create-issue-from-file
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: alex-page/github-project-automation-plus
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-18 12:19:25 +00:00

73 lines
2.5 KiB
YAML

# Copyright © 2023 OpenIM open source community. All rights reserved.
#
# Licensed 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: Auto PR to release
on:
pull_request:
# types:
# - closed
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
sync-issue-to-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Sync Issue to PR
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
run: |
PR_BODY="${{ github.event.pull_request.body }}"
ISSUE_NUMBER=$(echo "$PR_BODY" | grep -oP 'Fixes #\K\d+')
if [[ -z "$ISSUE_NUMBER" ]]; then
echo "No Issue number found."
exit 1
fi
echo "Issue number found: $ISSUE_NUMBER"
# Using GitHub CLI to get issue details
gh issue view "$ISSUE_NUMBER" --repo "${{ github.repository }}" --json labels,assignees,milestone,title > issue_data.json
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "Installing jq..."
sudo apt-get install -y jq
fi
# Parse data with jq
LABELS=$(jq -r '.labels | map(.name) | join(",")' issue_data.json)
ASSIGNEES=$(jq -r '.assignees | map(.login) | join(",")' issue_data.json)
MILESTONE=$(jq -r '.milestone.title' issue_data.json)
# Check if any of the fields are empty and set them to None
LABELS=${LABELS:-None}
ASSIGNEES=${ASSIGNEES:-None}
MILESTONE=${MILESTONE:-None}
# Edit the PR with issue details, handling empty fields
gh pr edit "${{ github.event.pull_request.number }}" --repo "${{ github.repository }}" \
${LABELS:+--add-label "$LABELS"} \
${ASSIGNEES:+--add-assignee "$ASSIGNEES"} \
${MILESTONE:+--milestone "$MILESTONE"}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}