Skip to content

[ci] fix no write permission to commit #140

[ci] fix no write permission to commit

[ci] fix no write permission to commit #140

name: Chisel and CIRCT Bump
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- labeled
jobs:
bump-deps:
name: "Bump Chisel and CIRCT"
if: ${{ !cancelled() }}
runs-on: [self-hosted, linux, nixos]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: Bump Chisel
run: |
cd nix/t1
nix run '.#nvfetcher' -- -f '^chisel$'
- name: Bump circt
run: |
oldFirtool="$(nix build '.#circt' --no-link --print-out-paths)/bin/firtool"
nix flake update nixpkgs-for-circt
newFirtool="$(nix build '.#circt' --no-link --print-out-paths)/bin/firtool"
diff_bin="$(nix build '.#diffutils' --no-link --print-out-paths)/bin/diff"
if "$diff_bin" -u <($oldFirtool --version) <($newFirtool --version); then
# if unchanged
git restore flake.lock
fi
- name: Bump all mill deps
run: |
oldHash=$(nix derivation show .#t1.elaborator.millDeps | jq -r 'to_entries[0].value.env.outputHash')
nix build '.#t1.elaborator.millDeps' --rebuild > t1-milldeps-log.txt 2>&1 || true
newHash=$(cat t1-milldeps-log.txt \
| grep -P '^\s+got:\s+sha256-.*$' \
| cut -d':' -f2 \
| xargs)
if [ -z "$newHash" ] || [ "$newHash" = "$oldHash" ]; then
echo "Original build logs for debug: "
cat t1-milldeps-log.txt
echo "Hash unchanged, exit"
exit 0
fi
echo "Updating hash $oldHash to $newHash"
sed -i "s|$oldHash|$newHash|" nix/t1/t1.nix
- name: Commit changes
permissions:

Check failure on line 52 in .github/workflows/daily-regression.yml

View workflow run for this annotation

GitHub Actions / Chisel and CIRCT Bump

Invalid workflow file

The workflow is not valid. .github/workflows/daily-regression.yml (Line: 52, Col: 9): Unexpected value 'permissions'
contents: write
env:
GITHUB_TOKEN: ${{ secrets.T1_PR_PAT }}
run: |
git config user.name Avimitin
git config user.email [email protected]
currentDate=$(date +%F)
branch="dependencies-bumping-$currentDate"
git checkout -b "$branch"
git add 'nix/t1'
git add 'flake.lock'
fileUnchanged() {
git diff --quiet --exit-code "$@"
}
if ! git diff --quiet --cached --exit-code; then
updatedFiles=$(git diff --cached --name-only)
echo "File changed"
git commit -m "[deps] Bump T1 dependencies"
git push origin "$branch" --force-with-lease
nix run '.#gh' -- \
pr create --title "Bump T1 dependencies" --body "Updated: $updatedFiles"
fi