diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index ba935a3446..d7a4d9edac 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -6,7 +6,6 @@ on: branches: - main pull_request_target: - paths-ignore: ["docs/**", "**.md"] types: [opened, synchronize, labeled] branches: - main @@ -142,7 +141,7 @@ jobs: Cache_Benchmarks: name: Micro Benchmarks - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && !contains(github.event_path, 'docs/') && !endswith(github.event_path, '.md') permissions: pull-requests: write contents: write @@ -212,3 +211,9 @@ jobs: - name: Check Degradation run: ./scripts/criterion_compare.rs benches/main_benchmarks.json benches/benchmarks.json check + + draft_release: + name: Draft Release + if: github.event_name == 'pull_request_target' + uses: ./.github/workflows/draft-release.yml + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 083e51df03..7c2422a1ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,6 @@ on: pull_request: branches: [main] types: [opened, reopened, synchronize] - pull_request_target: - types: [opened, reopened, synchronize] release: types: [published] permissions: @@ -96,31 +94,9 @@ jobs: draft_release: name: Draft Release - if: (github.event_name == 'pull_request_target') || (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'release' && github.event.action == 'published') - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout Current Branch (Fast) - uses: actions/checkout@v4 - - - id: create_release - uses: release-drafter/release-drafter@v5 - if: (github.event_name == 'pull_request_target') || (github.event_name == 'push' && github.ref == 'refs/heads/main') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - config-name: release-drafter.yml - - - name: Set Output for Later Jobs - id: set_output - run: | - echo "create_release_name=${{ steps.create_release.outputs.name }}" >> $GITHUB_OUTPUT - echo "create_release_id=${{ steps.create_release.outputs.id }}" >> $GITHUB_OUTPUT - outputs: - create_release_name: ${{ steps.set_output.outputs.create_release_name }} - create_release_id: ${{ steps.set_output.outputs.create_release_id }} + if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'release' && github.event.action == 'published') + uses: ./.github/workflows/draft-release.yml + secrets: inherit release: name: Release diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 0000000000..7b2ab523ff --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,40 @@ +name: Draft Release + +on: + workflow_call: + inputs: + draft: + required: true + type: boolean + outputs: + create_release_name: + description: "Release Name" + value: ${{ steps.set_output.outputs.create_release_name }} + create_release_id: + description: "Release Id" + value: ${{ steps.set_output.outputs.create_release_id }} + +jobs: + draft_release: + name: Draft Release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout Current Branch (Fast) + uses: actions/checkout@v4 + + - id: create_release + uses: release-drafter/release-drafter@v5 + if: (github.event_name == 'pull_request_target') || (github.event_name == 'push' && github.ref == 'refs/heads/main') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + config-name: release-drafter.yml + + - name: Set Output for Later Jobs + id: set_output + run: | + echo "create_release_name=${{ steps.create_release.outputs.name }}" >> $GITHUB_OUTPUT + echo "create_release_id=${{ steps.create_release.outputs.id }}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..f57a0b4345 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,11 @@ +name: check_kar + +on: + pull_request: + branches: [main] + types: [opened, reopened, synchronize] +jobs: + draft_release: + name: Draft Release + uses: ./.github/workflows/job1.yml + secrets: inherit \ No newline at end of file diff --git a/a.txt b/a.txt new file mode 100644 index 0000000000..67542283f4 --- /dev/null +++ b/a.txt @@ -0,0 +1 @@ +Hello i am asdasd rmpty. \ No newline at end of file