diff --git a/.github/workflows/cut-release.yaml b/.github/workflows/cut-release.yaml index 846954a..5980703 100644 --- a/.github/workflows/cut-release.yaml +++ b/.github/workflows/cut-release.yaml @@ -20,6 +20,13 @@ jobs: with: fetch-depth: 0 + - name: Create GitHub App token + uses: actions/create-github-app-token@v2 + id: app-token + with: + app-id: ${{ secrets.PAPER_COMPUTE_CO_BOT_APP_ID }} + private-key: ${{ secrets.PAPER_COMPUTE_CO_BOT_PRIVATE_KEY }} + - name: Install Dagger uses: dagger/dagger-for-github@v8.2.0 with: @@ -28,10 +35,12 @@ jobs: - name: Create release via ghrelease run: | dagger call -m github.com/papercomputeco/daggerverse/ghrelease \ - --token=env:GH_TOKEN \ - with-repo --repo=papercomputeco/masterblaster \ - with-source --source=. \ + --token=env://GH_TOKEN \ + with-repo \ + --repo="${ github.repository }" \ + with-source \ + --source=. \ create env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..55d62a0 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,42 @@ +name: Check PR + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + contents: read + pull-requests: read + +env: + DAGGER_VERSION: "0.20.1" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check-pr-title: + name: Check PR Title + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Dagger + uses: dagger/dagger-for-github@v8.2.0 + with: + version: ${{ env.DAGGER_VERSION }} + + - name: Check PR title conformance + run: | + dagger call -m github.com/papercomputeco/daggerverse/ghcontrib \ + --token=env://GH_TOKEN \ + --repo="${{ github.repository }}" \ + check-pull-request \ + --number "${{ github.event.pull_request.number }}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }} +