From f378ecc4d465694c6315f87589d42dc3ae1d5cbb Mon Sep 17 00:00:00 2001 From: Death-Satan <49744633+Death-Satan@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:36:19 +0800 Subject: [PATCH] Added moer Actions --- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ .github/workflows/transfer-issue.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/transfer-issue.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2fc8404 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Release + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/transfer-issue.yml b/.github/workflows/transfer-issue.yml new file mode 100644 index 0000000..b502dc9 --- /dev/null +++ b/.github/workflows/transfer-issue.yml @@ -0,0 +1,27 @@ +name: Issue Migration + +on: + issues: + types: [opened] + +jobs: + migrate_issue: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issue = context.payload.issue; + const newIssue = await github.rest.issues.create({ + owner: issue.owner, + repo: issue.repo, + title: issue.title, + body: issue.body, + labels: issue.labels, + assignees: issue.assignees + }); + console.log(`Created issue ${newIssue.data.number} in ${newIssue.data.repository.full_name}`); + - uses: actions/delete-issue@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }}