diff --git a/.changeset/long-keys-compare.md b/.changeset/long-keys-compare.md new file mode 100644 index 00000000000..e368e85fae5 --- /dev/null +++ b/.changeset/long-keys-compare.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": minor +--- + +Changed trigger to workflow_dispatch and switched from issues to pr as a source of metrics diff --git a/.github/workflows/repo-metrics.yml b/.github/workflows/repo-metrics.yml index c3bb2f2338c..fec9c26f946 100644 --- a/.github/workflows/repo-metrics.yml +++ b/.github/workflows/repo-metrics.yml @@ -1,11 +1,13 @@ -name: Monthly issue metrics -on: repository_dispatch +name: Github metrics +on: + workflow_dispatch: + permissions: contents: read jobs: build: - name: issue metrics + name: github metrics runs-on: ubuntu-22.04 permissions: issues: write @@ -24,24 +26,18 @@ jobs: echo "$first_day..$last_day" echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV" - - name: Run issue-metrics tool + #Set an environment variable containing month and year for issue name + echo "last_month_tag=$(date -d "last month" +%Y-%m)" >> "$GITHUB_ENV" + + - name: Run metrics tool uses: github/issue-metrics@v3 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SEARCH_QUERY: 'repo:saleor/saleor-dashboard is:issue created:${{ env.last_month }} -reason:"not planned"' - - - name: Create issue metrics report - run: | - report_filename="issue_metrics_$(date +'%Y-%m').md" - echo "This is the monthly issue metrics report." > "$report_filename" - echo "Add your metrics data here." >> "$report_filename" - echo "report_filename=$report_filename" >> "$GITHUB_ENV" - # Set an environment variable with the tag which we append to the title of GH issue. - echo "last_month_tag=$(date -d "last month" +%Y-%m)" >> "$GITHUB_ENV" + SEARCH_QUERY: 'repo:saleor/saleor-dashboard is:pr created:${{ env.last_month }} -reason:"not planned"' - name: Create issue uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5.0.0 with: - title: Monthly issue metrics report for ${{ env.last_month_tag }} + title: Monthly pr metrics report for ${{ env.last_month_tag }} token: ${{ secrets.GITHUB_TOKEN }} - content-filepath: ${{ env.report_filename }} + content-filepath: ./issue_metrics.md