apache/fory

sync workflow is failing

Closed this issue · 7 comments

Search before asking

  • I had searched in the issues and found no similar issues.

Version

n/a

Component(s)

Other

Minimal reproduce step

https://github.com/apache/fory/actions/workflows/sync.yml

What did you expect to see?

n/a

What did you see instead?

The action betahuhn/repo-file-sync-action@v1 is not allowed in apache/fory because all actions must be from a repository owned by your enterprise, created by GitHub, verified in the GitHub Marketplace, or match one of the patterns...

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

https://github.com/apache/fory/actions/workflows/sync.yml?page=2
Image

It fails three weeks before, not sure what happend

Check if the action changed

Can you go to Actions > General and enter betahuhn/repo-file-sync-action in Allow enterprise, and select non-enterprise, actions and reusable workflows?

@esafak I don't have the permission for that, let me open an apache infra issue to track this

It seems apache has tightened security. Would you like to replace the action with a script like this?

# .github/workflows/sync-folders.yml
name: sync-folders

on:
  push:
    branches: [main]
    paths:
      - 'src/common/**'
      - 'docs/specs/**'
      - 'lib/utils/**'

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout target repo
        uses: actions/checkout@v4
        with:
          repository: apache/fory-site
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Sync mapped folders
        run: |
          set -euo pipefail

          # Map: source-folder destination-folder
          declare -A MAP=(
            ["docs/guide"]="docs/guide"
            ["docs/specification"]="docs/specification"
            ["docs/benchmarks"]="static/img/benchmarks"
          )

          MSG="chore: sync folders from apache/fory @ $(date -u +%Y-%m-%d_%H:%M:%S)"
          git remote add source https://github.com/apache/fory.git
          git fetch source main --depth=1

          for src in "${!MAP[@]}"; do
            dst=${MAP[$src]}
            mkdir -p "$(dirname "$dst")"
            git checkout source/main -- "$src"
            if [[ "$src" != "$dst" ]]; then
              rsync -a --delete "$src/" "$dst/"
              rm -rf "$src"
            fi
            git add "$dst"
          done

          git diff --cached --quiet && { echo "No changes"; exit 0; }

          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"
          git commit -m "$Msg"
          git push

@esafak It has been allowed in asf/infra: https://github.com/apache/infrastructure-actions/blob/024ddd1e4112c18eb7054d814ecf08e1b27c8248/actions.yml#L180 . I'm not sure why it still fail, I change to lowercase to see whether the syncwill be allowed in #2541