feat(rules/golang): add 22 Go security rules with L1 precision and ve… #485
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: Build and Publish Docker Image | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - '*' | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-tags: true | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Compute Version and Commit Info | |
| id: cpfinfo | |
| run: | | |
| VERSION=$(cat sast-engine/VERSION) | |
| COMMIT=$(git describe --tags) | |
| echo $VERSION | |
| echo $COMMIT | |
| echo "PROJECT_VERSION=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "PROJECT_COMMIT=${COMMIT}" >> $GITHUB_OUTPUT | |
| - name: Determine Docker Tag | |
| id: vars | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| VERSION=$(cat sast-engine/VERSION) | |
| echo "tag1=v${VERSION}" >> $GITHUB_OUTPUT | |
| echo "tag2=stable-latest" >> $GITHUB_OUTPUT | |
| elif [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]; then | |
| VERSION=$(cat sast-engine/VERSION) | |
| echo "tag1=dev-${VERSION}" >> $GITHUB_OUTPUT | |
| echo "tag2=nightly-latest" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag1=dev" >> $GITHUB_OUTPUT | |
| echo "tag2=nightly-dev" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build and push to Docker Hub | |
| uses: docker/build-push-action@v6 | |
| env: | |
| POSTHOG_WEB_ANALYTICS: ${{ secrets.POSTHOG_WEB_ANALYTICS }} | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| build-args: | | |
| POSTHOG_WEB_ANALYTICS=${{ secrets.POSTHOG_WEB_ANALYTICS }} | |
| PROJECT_COMMIT=${{ steps.cpfinfo.outputs.PROJECT_COMMIT }} | |
| PROJECT_VERSION=${{ steps.cpfinfo.outputs.PROJECT_VERSION }} | |
| tags: | | |
| ${{ secrets.DOCKER_USERNAME }}/code-pathfinder:${{ steps.vars.outputs.tag1 }} | |
| ${{ secrets.DOCKER_USERNAME }}/code-pathfinder:${{ steps.vars.outputs.tag2 }} |