mirror of
https://github.com/rustsec/advisory-db.git
synced 2026-07-22 01:06:54 -04:00
51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
name: Assign IDs
|
|
|
|
on:
|
|
push:
|
|
branches: main
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
assign-ids:
|
|
name: Assign IDs
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # for create-pull-request
|
|
pull-requests: write # for create-pull-request
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Cache cargo bin
|
|
id: admin-cache
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/.cargo/bin
|
|
key: rustsec-admin-5a1737650d9b27d38941a23ccca1cfaecf568b63
|
|
|
|
- name: Install rustsec-admin
|
|
if: steps.admin-cache.outputs.cache-hit != 'true'
|
|
run: cargo install --git https://github.com/rustsec/rustsec rustsec-admin --rev 5a1737650d9b27d38941a23ccca1cfaecf568b63
|
|
|
|
- name: Assign IDs
|
|
id: assign
|
|
run: |
|
|
message=$(rustsec-admin assign-id --github-actions-output)
|
|
echo "commit_message=${message}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create duplicate ID assignment guard
|
|
run: |
|
|
echo "This file causes merge conflicts if two ID assignment jobs run concurrently." > .duplicate-id-guard
|
|
echo "This prevents duplicate ID assignment due to a race between those jobs." >> .duplicate-id-guard
|
|
ls -R ./crates/ ./rust/ | sha256sum >> .duplicate-id-guard
|
|
|
|
- name: Create pull request
|
|
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: ${{ steps.assign.outputs.commit_message }}
|
|
title: ${{ steps.assign.outputs.commit_message }}
|
|
branch: assign-ids
|