GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — actions/.github/workflows/lock.yml at main · ComPWA/actions 380 lines (367 loc) · 13 KB / Copy pathlock.ymlFile metadata and controls380 lines (367 loc) · 13 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 name: Update env: COMMIT_TITLE: "MAINT: upgrade lock files" FORCE_COLOR: yes on: workflow_call: inputs: generate-only: description: Generate lock-file artifacts without pushing changes or creating a PR. Defaults to false for existing callers. default: false type: boolean outputs: lock-files: description: Space-separated lock-file paths selected for upgrading, or an empty string when no upgrade is requested. value: ${{ jobs.find-lock-files.outputs.lock-files }} secrets: token: description: >- Personal Access Token used to push changes and create upgrade PRs. Required unless generate-only is true. Omit it when autofix.ci collects the generated artifacts. required: false workflow_dispatch: jobs: pr-exists: name: Check if PR already exists if: >- !inputs.generate-only && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') outputs: exists: ${{ steps.pr-exists.outputs.exists }} runs-on: ubuntu-slim steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: List open pull requests id: list-prs run: | delimiter="$(openssl rand -hex 8)" echo "prs<<${delimiter}" >> $GITHUB_OUTPUT for pr in $( gh pr list \ --json title,url \ --jq '.[] | select(.title == "${{ env.COMMIT_TITLE }}") | .url' \ --state open ); do echo "$pr" | tee -a $GITHUB_OUTPUT done echo "${delimiter}" >> $GITHUB_OUTPUT env: GH_TOKEN: ${{ github.token }} - name: Check if constraints PR exists id: pr-exists run: | prs="${{ steps.list-prs.outputs.prs }}" if [[ -z "$prs" ]]; then echo "exists=false" | tee -a "$GITHUB_OUTPUT" echo "✅ No PR with title '${{ env.COMMIT_TITLE }}' found." else echo "exists=true" | tee -a "$GITHUB_OUTPUT" echo "❌ PR with title '${{ env.COMMIT_TITLE }}' already exists." fi - name: Emit warning if there is already a PR that updates the lock files if: steps.pr-exists.outputs.exists == 'true' run: >- echo "::notice::There is already a PR that is updating the lock files, see ${{ steps.list-prs.outputs.prs }}." pr-has-lock-label: name: Check PR description if: >- github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-slim outputs: lock-upgrade: ${{ steps.check.outputs.lock-upgrade }} steps: - name: Get PR description id: pr-labels uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const pr = await github.rest.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number }); const labels = pr.data.labels.map(label => label.name).join(', '); const fs = require('fs'); fs.writeFileSync('pr-labels.txt', labels); return labels; result-encoding: string - name: Show PR labels run: cat pr-labels.txt - name: Check for PR label "⬆️ Lock" id: check run: | if grep -q '⬆️ Lock' pr-labels.txt; then echo "lock-upgrade=true" | tee -a $GITHUB_OUTPUT else echo "lock-upgrade=false" | tee -a $GITHUB_OUTPUT fi - name: Emit warning if PR label "⬆️ Lock" is not found if: steps.check.outputs.lock-upgrade == 'false' run: >- echo "::notice::This PR does not have the label "⬆️ Lock", so the lock files will not be upgraded." find-lock-files: if: >- always() && ( needs.pr-exists.outputs.exists == 'false' || needs.pr-has-lock-label.outputs.lock-upgrade == 'true' ) name: Find lock files needs: - pr-has-lock-label - pr-exists runs-on: ubuntu-slim outputs: lock-files: ${{ steps.check.outputs.lock-files }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - id: check name: Determine available lock files run: | lock_file_patterns=( .constraints/ .pre-commit-config.yaml Manifest.toml pixi.lock uv.lock ) files=() for file in "${lock_file_patterns[@]}"; do [[ -e $file ]] && files+=("$file") done echo "lock-files=${files[*]}" | tee -a $GITHUB_OUTPUT create-matrix: name: Determine Python versions if: always() && contains( needs.find-lock-files.outputs.lock-files, '.constraints/' ) needs: - find-lock-files outputs: matrix: ${{ steps.versions.outputs.matrix }} runs-on: ubuntu-slim steps: - id: versions uses: $/create-python-version-matrix pip-constraints: name: pip constraint files if: always() && contains( needs.find-lock-files.outputs.lock-files, '.constraints/' ) needs: - create-matrix - find-lock-files runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - if: matrix.python-version != 'skipped' uses: ComPWA/update-pip-constraints@ca39b3fe41dc29bb63fe6253648a564063b76076 # 1.1.1 with: python-version: ${{ matrix.python-version }} # The pinned updater does not explicitly include hidden directories. - if: matrix.python-version != 'skipped' uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: pip-constraints-${{ matrix.python-version }} path: .constraints/py${{ matrix.python-version }}.txt include-hidden-files: true if-no-files-found: error overwrite: true pixi-lock: name: pixi.lock if: always() && contains( needs.find-lock-files.outputs.lock-files, 'pixi.lock' ) needs: - find-lock-files runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: prefix-dev/setup-pixi@9936258fee697aff89b3fed6ca1f80a382ef694e # v0.11.3 with: run-install: false - name: Upgrade lock files run: pixi update - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: pixi-lock path: pixi.lock julia: name: Manifest.toml if: always() && contains( needs.find-lock-files.outputs.lock-files, 'Manifest.toml' ) needs: - find-lock-files runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - if: hashFiles('pixi.lock') == '' uses: julia-actions/setup-julia@da908477b5db94c10ffce8cfea9f2b3b9d5db687 # v3.0.3 - if: hashFiles('pixi.lock') uses: prefix-dev/setup-pixi@9936258fee697aff89b3fed6ca1f80a382ef694e # v0.11.3 with: activate-environment: true - name: Update Julia Manifest.toml run: julia -e 'using Pkg; Pkg.update()' - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: Manifest-toml path: Manifest.toml pre-commit: name: .pre-commit-config.yaml if: always() && contains( needs.find-lock-files.outputs.lock-files, '.pre-commit-config.yaml' ) needs: - find-lock-files runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: "3.14" - uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0 - env: FORCE_COLOR: True UV_SYSTEM_PYTHON: True run: uvx prek autoupdate shell: bash - name: Show changes run: git diff --color --unified=0 shell: bash - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: if-no-files-found: error include-hidden-files: true name: pre-commit path: .pre-commit-config.yaml uv-lock: name: uv.lock if: always() && contains( needs.find-lock-files.outputs.lock-files, 'uv.lock' ) needs: - find-lock-files runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0 - run: uv lock --upgrade - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: uv-lock path: uv.lock push: name: Push changes if: always() && !inputs.generate-only runs-on: ubuntu-slim env: PUSH: ${{ needs.pr-has-lock-label.outputs.lock-upgrade == 'true' }} needs: - create-matrix - find-lock-files - julia - pip-constraints - pixi-lock - pre-commit - uv-lock - pr-has-lock-label steps: - if: env.PUSH == 'true' name: Check publishing token env: PUBLISH_TOKEN: ${{ secrets.token }} run: | if [[ -z "$PUBLISH_TOKEN" ]]; then echo '::error::Pass the token secret for publishing, or use generate-only with autofix.ci.' exit 1 fi - if: env.PUSH == 'true' uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: token: ${{ secrets.token || github.token}} - if: env.PUSH == 'true' uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: merge-multiple: true path: . - if: env.PUSH == 'true' name: Show changed files run: | git config --global color.ui always git status --short - if: env.PUSH == 'true' name: Show changes run: git diff --color --unified=0 - if: env.PUSH == 'true' name: Commit and push changes run: | git remote set-url origin https://x-access-token:${{ secrets.token }}@github.com/${{ github.repository }} git config --global user.name "GitHub" git config --global user.email "[email protected]" git checkout -b ${{ github.head_ref }} if [[ $(git status -s) ]]; then git add -A git commit -m '${{ env.COMMIT_TITLE }}' git config pull.rebase true git pull origin ${{ github.head_ref }} git push origin HEAD:${{ github.head_ref }} fi - if: >- always() && ( contains(join(needs.*.result, ','), 'failure') || contains(join(needs.*.result, ','), 'cancelled') ) name: Fail if a lock file could not be updated run: | echo "::error::One of the lock file jobs did not succeed: $NEEDS" exit 1 env: NEEDS: ${{ toJSON(needs.*.result) }} create-pr: name: Create PR runs-on: ubuntu-slim if: >- always() && !cancelled() && !failure() && !inputs.generate-only && needs.pr-exists.outputs.exists == 'false' needs: - julia - pip-constraints - pixi-lock - pre-commit - uv-lock - pr-exists steps: - name: Check publishing token env: PUBLISH_TOKEN: ${{ secrets.token }} run: | if [[ -z "$PUBLISH_TOKEN" ]]; then echo '::error::Pass the token secret to create an upgrade PR.' exit 1 fi - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: token: ${{ secrets.token }} - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: merge-multiple: true path: . - name: Show changed files run: | git config --global color.ui always git status --short - name: Show changes run: git diff --color --unified=0 - name: Create Pull Request uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3 with: commit-message: ${{ env.COMMIT_TITLE }} committer: GitHub <[email protected]> author: GitHub <[email protected]> title: ${{ env.COMMIT_TITLE }} body: >- This PR updates all lock files. It was created automatically by a scheduled workflow. labels: | ⬆️ Lock branch-suffix: timestamp delete-branch: true token: ${{ secrets.token }} |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |