Update gitcrawl for v0.4.4 (gitcrawl-v0.4.4-26343018469-1) #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Formula | |
| run-name: Update ${{ inputs.formula }} for ${{ inputs.tag }}${{ inputs.request_id && format(' ({0})', inputs.request_id) || '' }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| formula: | |
| description: "Formula name (e.g., gitcrawl)" | |
| required: true | |
| type: string | |
| tag: | |
| description: "Release tag to update formula for" | |
| required: true | |
| type: string | |
| repository: | |
| description: "Source repository (e.g., openclaw/gitcrawl)" | |
| required: true | |
| type: string | |
| description: | |
| description: "Formula description used when creating a missing formula" | |
| required: false | |
| type: string | |
| macos_artifact: | |
| description: "macOS artifact name (defaults to <formula>-macos-universal.tar.gz)" | |
| required: false | |
| type: string | |
| linux_url: | |
| description: "Linux archive URL (defaults to the GitHub tag archive)" | |
| required: false | |
| type: string | |
| artifact_template: | |
| description: "Multi-arch asset template, e.g. {formula}_{version}_{target}.tar.gz" | |
| required: false | |
| type: string | |
| artifact_url: | |
| description: "Direct artifact/source URL template for top-level formulae" | |
| required: false | |
| type: string | |
| target_aliases: | |
| description: "Comma-separated canonical=artifact-target aliases for custom asset names" | |
| required: false | |
| type: string | |
| cask: | |
| description: "Optional cask name to update with the same release" | |
| required: false | |
| type: string | |
| cask_artifact: | |
| description: "Release asset name for the optional cask" | |
| required: false | |
| type: string | |
| request_id: | |
| description: "Unique caller-generated ID used to identify this workflow run" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-formula: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout tap repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Update formula | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| args=( | |
| --formula "${{ inputs.formula }}" | |
| --tag "${{ inputs.tag }}" | |
| --repository "${{ inputs.repository }}" | |
| ) | |
| if [ -n "${{ inputs.description }}" ]; then | |
| args+=(--description "${{ inputs.description }}") | |
| fi | |
| if [ -n "${{ inputs.macos_artifact }}" ]; then | |
| args+=(--macos-artifact "${{ inputs.macos_artifact }}") | |
| fi | |
| if [ -n "${{ inputs.linux_url }}" ]; then | |
| args+=(--linux-url "${{ inputs.linux_url }}") | |
| fi | |
| if [ -n "${{ inputs.artifact_template }}" ]; then | |
| args+=(--artifact-template "${{ inputs.artifact_template }}") | |
| fi | |
| if [ -n "${{ inputs.artifact_url }}" ]; then | |
| args+=(--artifact-url "${{ inputs.artifact_url }}") | |
| fi | |
| if [ -n "${{ inputs.target_aliases }}" ]; then | |
| args+=(--target-aliases "${{ inputs.target_aliases }}") | |
| fi | |
| if [ -n "${{ inputs.cask }}" ]; then | |
| args+=(--cask "${{ inputs.cask }}") | |
| fi | |
| if [ -n "${{ inputs.cask_artifact }}" ]; then | |
| args+=(--cask-artifact "${{ inputs.cask_artifact }}") | |
| fi | |
| python3 .github/scripts/update_formula.py "${args[@]}" | |
| - name: Commit and push | |
| run: | | |
| FORMULA="${{ inputs.formula }}" | |
| TAG="${{ inputs.tag }}" | |
| CASK="${{ inputs.cask }}" | |
| git add "Formula/${FORMULA}.rb" | |
| if [ -n "$CASK" ]; then | |
| git add "Casks/${CASK}.rb" | |
| fi | |
| if git diff --cached --quiet; then | |
| echo "Formula/${FORMULA}.rb${CASK:+ and Casks/${CASK}.rb} already up to date" | |
| exit 0 | |
| fi | |
| if [ -n "$CASK" ]; then | |
| git commit -m "${FORMULA}: update formula and cask for ${TAG}" | |
| else | |
| git commit -m "${FORMULA}: update formula for ${TAG}" | |
| fi | |
| git push |