Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .github/workflows/internal-commit-results.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Commit Results

on:
workflow_call:
inputs:
Expand All @@ -18,9 +17,19 @@ on:
type: string
default: "ci: Add automated results"
commit-directory:
description: "The directory to commit"
description: "The directory where the artifacts will be downloaded and committed"
required: true
type: string
second-commit-directory:
description: "An optional second directory where the same files will be copied and committed"
required: false
type: string
default: ""
file-filter:
description: "A filter to apply to files in the commit-directory when staging them with git add. Example: *.md"
required: false
type: string
default: ""
uploaded-artifact-name:
description: "The name of the uploaded artifact"
required: true
Expand All @@ -45,18 +54,35 @@ jobs:
with:
name: ${{ inputs.uploaded-artifact-name }}
path: ${{ inputs.commit-directory }}


- name: Copy artifacts into the second directory
if: inputs.second-commit-directory != ''
run: rm -rf ${{ inputs.second-commit-directory }} && cp -r ${{ inputs.commit-directory }} ${{ inputs.second-commit-directory }}

- name: Display environment variable "github.event_name"
run: echo "github.event_name=${{ github.event_name }}"


- name: Assemble GIT_ADD_PATH
run: echo "GIT_ADD_PATH=${{ inputs.commit-directory }}${{ inputs.file-filter != '' && '/' || '' }}${{ inputs.file-filter }}" >> $GITHUB_ENV
- name: Display GIT_ADD_PATH
run: echo "GIT_ADD_PATH=${{ env.GIT_ADD_PATH }}"

- name: Assemble SECOND_GIT_ADD_PATH
if: inputs.second-commit-directory != ''
run: echo "SECOND_GIT_ADD_PATH=${{ inputs.second-commit-directory }}${{ inputs.file-filter != '' && '/' || '' }}${{ inputs.file-filter }}" >> $GITHUB_ENV
- name: Display SECOND_GIT_ADD_PATH
if: inputs.second-commit-directory != ''
run: echo "SECOND_GIT_ADD_PATH=${{ env.SECOND_GIT_ADD_PATH }}"

- name: Prepare commit of changes in `${{ inputs.commit-directory }}`
run: |
git config --global user.name '${{ inputs.commit-author-name }}'
git config --global user.email '${{ inputs.commit-author-email }}'
git config --local http.postBuffer 524288000
git fetch origin
git status
git add ${{ inputs.commit-directory }}
git add ${{ env.GIT_ADD_PATH }} ${{ env.SECOND_GIT_ADD_PATH }}
git status

- name: Commit and push changes in `${{ inputs.commit-directory }}`
Expand All @@ -67,6 +93,6 @@ jobs:
git status
git rebase --strategy-option=theirs origin/main --verbose
git status
git add ${{ inputs.commit-directory }}
git add ${{ env.GIT_ADD_PATH }} ${{ env.SECOND_GIT_ADD_PATH }}
git status
git push --verbose
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ jobs:
commit-author-name: "${{ github.event.repository.name }} Continuous Integration"
commit-author-email: "7671054+JohT@users.noreply.github.com"
commit-message: "Automated code structure analysis results (CI)"
commit-directory: "./analysis-results/*.md"
commit-directory: "./analysis-results"
file-filter: "*.md"
uploaded-artifact-name: ${{ needs.generate-report-reference-documentation.outputs.documentation-upload-name }}
secrets:
repository-commit-token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/java-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
commit-author-email: "7671054+JohT@users.noreply.github.com"
commit-message: "Automated code structure analysis results (CI)"
commit-directory: "analysis-results/${{ needs.prepare-code-to-analyze.outputs.project-name }}/${{ needs.prepare-code-to-analyze.outputs.analysis-name }}"
second-commit-directory: "analysis-results/${{ needs.prepare-code-to-analyze.outputs.project-name }}/latest"
uploaded-artifact-name: ${{ needs.analyze-code-graph.outputs.uploaded-analysis-results }}
secrets:
repository-commit-token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/typescript-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
commit-author-email: "7671054+JohT@users.noreply.github.com"
commit-message: "Automated code structure analysis results (CI)"
commit-directory: "analysis-results/${{ needs.prepare-code-to-analyze.outputs.project-name }}/${{ needs.prepare-code-to-analyze.outputs.analysis-name }}"
second-commit-directory: "analysis-results/${{ needs.prepare-code-to-analyze.outputs.project-name }}/latest"
uploaded-artifact-name: ${{ needs.analyze-code-graph.outputs.uploaded-analysis-results }}
secrets:
repository-commit-token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
Loading
Loading