Add branding and prepare the action for the marketplace (#25) #3
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: Sync to Public Repository | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| jobs: | |
| sync: | |
| name: Push to public repository | |
| # Only run in the internal repository, not in the public one, and only for main or tags | |
| if: github.repository != 'tracebit-com/tracebit-community-action' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Full history needed for pushing | |
| fetch-tags: true | |
| persist-credentials: false # Don't persist the default GITHUB_TOKEN | |
| - name: Configure credentials | |
| uses: tracebit-com/tracebit-community-action@d0a68cb29196eafce908de76ec596a7e9ca049da | |
| with: | |
| customer-id: ${{ vars.SECURITY_CUSTOMER_ID }} | |
| api-token: ${{ secrets.SECURITY_API_TOKEN }} | |
| profile: administrator | |
| profile-region: us-east-1 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Add public repository as remote | |
| env: | |
| PUBLIC_REPO_TOKEN: ${{ secrets.PUBLIC_REPO_TOKEN }} | |
| run: | | |
| git remote add public https://x-access-token:${PUBLIC_REPO_TOKEN}@github.com/tracebit-com/tracebit-community-action.git | |
| - name: Push to public repository | |
| run: | | |
| git push public ${{ github.ref }} |