diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9e54eda34..c42d24817 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,14 +22,14 @@ jobs: outputs: integration: ${{ steps.zip-name.outputs.integration }} preproduction: ${{ steps.zip-name.outputs.preproduction }} - production: ${{ github.event.repository.name }} + production: ${{ github.event.repository.name }}.zip steps: - name: Generate zip file name id: zip-name run: | date=$(date -d '+2 hours' +'%Y-%m-%d_%H-%M-%S') - echo "$ENV=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date" >> "$GITHUB_OUTPUT" + echo "$ENV=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date.zip" >> "$GITHUB_OUTPUT" env: ENV: ${{ matrix.env }} REPOSITORY: ${{ github.event.repository.name }} diff --git a/.github/workflows/push-to-bucket.yml b/.github/workflows/push-to-bucket.yml index 4258c21ce..c4fcffcb1 100644 --- a/.github/workflows/push-to-bucket.yml +++ b/.github/workflows/push-to-bucket.yml @@ -28,24 +28,24 @@ on: jobs: bucket-zip-name: - name: Generate zip file name + name: Generate zip file name for GCP bucket runs-on: ubuntu-latest outputs: - integration: ${{ inputs.zip-name }}.zip - preproduction: ${{ inputs.zip-name }}.zip - production: ${{ steps.zip-name.outputs.name }}.zip + integration: ${{ inputs.zip-name }} + preproduction: ${{ inputs.zip-name }} + production: ${{ steps.zip-name.outputs.name }} steps: - name: Generate zip file name id: zip-name run: | date=$(date -d '+2 hours' +'%Y-%m-%d_%H-%M-%S') - echo "name=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date" >> "$GITHUB_OUTPUT" + echo "name=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date.zip" >> "$GITHUB_OUTPUT" env: ENV: production REPOSITORY: ${{ inputs.repository-name }} PS_VERSION: ${{ inputs.prestashop-version }} - PR_NUMBER: pr${{ inputs.pr-number }} + PR_NUMBER: ${{ inputs.pr-number }} push-to-bucket: name: ${{ inputs.env-upper }} - Create zip file and push to GCP bucket storage @@ -54,7 +54,7 @@ jobs: environment: ${{ inputs.env-lower }} permissions: id-token: write - contents: read + contents: write pull-requests: write if: inputs.triggered == true diff --git a/.github/workflows/push-to-repository.yml b/.github/workflows/push-to-repository.yml index b8cf66020..2b0981956 100644 --- a/.github/workflows/push-to-repository.yml +++ b/.github/workflows/push-to-repository.yml @@ -27,7 +27,7 @@ jobs: environment: ${{ inputs.env-lower }} permissions: id-token: write - contents: read + contents: write pull-requests: write if: inputs.triggered == true diff --git a/.github/workflows/update-release-draft.yml b/.github/workflows/update-release-draft.yml index 7ba2710ca..230c6b31d 100644 --- a/.github/workflows/update-release-draft.yml +++ b/.github/workflows/update-release-draft.yml @@ -21,7 +21,7 @@ jobs: environment: ${{ inputs.env-lower }} permissions: id-token: write - contents: read + contents: write pull-requests: write if: inputs.triggered == true env: @@ -39,25 +39,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - commitish: prestashop/1.7.x + commitish: prestashop/1.6.x - name: Prepare zip for release 👷 run: | cd ${{ inputs.repository-name }} zip -r ../${{ env.ZIP_NAME }} . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json' - - name: Clean existing assets ♻️ - shell: bash - run: | - curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 - assets=`bin/hub api -t repos/${{ inputs.repository-name }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'` - for asset in $assets - do - bin/hub api -X DELETE $asset - done - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish to GitHub Release 🛩️ uses: actions/upload-release-asset@v1.0.2 env: