diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7526c92 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: + - package-ecosystem: cargo + directory: / + schedule: + interval: weekly + day: monday + open-pull-requests-limit: 10 + groups: + rust-dependencies: + patterns: + - "*" + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + day: monday + open-pull-requests-limit: 5 + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67d7e53..cb039fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: env: CARGO_NET_GIT_FETCH_WITH_CLI: "true" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable with: diff --git a/.github/workflows/dependabot-linear.yml b/.github/workflows/dependabot-linear.yml new file mode 100644 index 0000000..67e5ff3 --- /dev/null +++ b/.github/workflows/dependabot-linear.yml @@ -0,0 +1,41 @@ +name: Dependabot Linear Integration + +on: + pull_request: + types: [opened] + +permissions: + pull-requests: read + +jobs: + create-linear-issue: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Create Linear Issue + env: + LINEAR_API_KEY: ${{ secrets.LINEAR_API_TOKEN }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_URL: ${{ github.event.pull_request.html_url }} + PR_BODY: ${{ github.event.pull_request.body }} + REPO_NAME: ${{ github.event.repository.name }} + run: | + DESCRIPTION="**Dependabot PR:** ${PR_URL} + + **Repository:** ${REPO_NAME} + + ${PR_BODY}" + + # Escape for JSON + TITLE=$(echo "$PR_TITLE" | jq -Rs '.') + DESC=$(echo "$DESCRIPTION" | jq -Rs '.') + + curl -s -X POST https://api.linear.app/graphql \ + -H "Content-Type: application/json" \ + -H "Authorization: ${LINEAR_API_KEY}" \ + -d "{ + \"query\": \"mutation { issueCreate(input: { title: ${TITLE}, description: ${DESC}, + teamId: \"c2acb063-92b9-4d9f-ab23-0ced91983a97\", + labelIds: [\"0ee40789-158e-4b1c-93b3-3974e1b80117\"] + }) { success issue { id identifier url } } }" + }'