From 648fca9784f76508c7d720acb6a4c5217c5d5e49 Mon Sep 17 00:00:00 2001 From: cancio Date: Tue, 19 Mar 2024 20:57:51 +0000 Subject: [PATCH 01/39] example --- article/main.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/article/main.tex b/article/main.tex index d324fb1..0036723 100644 --- a/article/main.tex +++ b/article/main.tex @@ -22,4 +22,6 @@ \bibliographystyle{./util/sbc} \bibliography{./util/references} -\end{document} \ No newline at end of file +\end{document} + +% example \ No newline at end of file From f4cff8e731f892b736311c730b51edc8dcc933b0 Mon Sep 17 00:00:00 2001 From: cancio Date: Tue, 19 Mar 2024 21:14:35 +0000 Subject: [PATCH 02/39] remove example --- article/main.tex | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/article/main.tex b/article/main.tex index 0036723..d324fb1 100644 --- a/article/main.tex +++ b/article/main.tex @@ -22,6 +22,4 @@ \bibliographystyle{./util/sbc} \bibliography{./util/references} -\end{document} - -% example \ No newline at end of file +\end{document} \ No newline at end of file From 3aba6ad3a5d95d66965b222d0851274f083d2e85 Mon Sep 17 00:00:00 2001 From: cancio Date: Tue, 19 Mar 2024 21:24:51 +0000 Subject: [PATCH 03/39] criando a action --- .github/workflows/latex_build.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 28ecf11..2b4a34f 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -1,9 +1,5 @@ name: Build LaTeX document -on: - push: - branches: - - '*' - - '!main' +on: pull_request jobs: build_latex: @@ -22,3 +18,16 @@ jobs: with: name: main path: article/main.pdf + - name: download artifact + uses: actions/download-artifact@v3 + with: + name: main + - name: comment PR + uses: tonyhallett/artifacts-url-comments@v1.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + prefix: Segue o pdf + suffix: Valeo + format: name + addTo: pullandissues \ No newline at end of file From 13c39b9ce6cac8233886b630bf8c841e599e24fe Mon Sep 17 00:00:00 2001 From: cancio Date: Tue, 19 Mar 2024 21:31:53 +0000 Subject: [PATCH 04/39] correcao --- .github/workflows/latex_build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 2b4a34f..449bf01 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -22,6 +22,11 @@ jobs: uses: actions/download-artifact@v3 with: name: main + + artifacts-url-comments: + name: add artifact links to pull request and related issues job + runs-on: windows-2019 + steps: - name: comment PR uses: tonyhallett/artifacts-url-comments@v1.1.0 env: From 547229beda7b92960f43ece6342333619ea203c1 Mon Sep 17 00:00:00 2001 From: cancio Date: Tue, 19 Mar 2024 23:56:57 +0000 Subject: [PATCH 05/39] corringo pr --- .github/workflows/latex_build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 449bf01..7fd7622 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -1,5 +1,8 @@ name: Build LaTeX document -on: pull_request +on: + workflow_run: + workflows: ["PR"] + types: [completed] jobs: build_latex: From 95e17748876feb2eb17a4e088fa5c1e33064d79e Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:02:51 +0000 Subject: [PATCH 06/39] corrigindo action --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 7fd7622..d3f6888 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -2,7 +2,7 @@ name: Build LaTeX document on: workflow_run: workflows: ["PR"] - types: [completed] + types: [edited] jobs: build_latex: From 3aac6a62977a36e6a15fd9302b6f45a4a6575083 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:04:31 +0000 Subject: [PATCH 07/39] agora vai --- .github/workflows/latex_build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index d3f6888..68c85c4 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -1,7 +1,6 @@ name: Build LaTeX document on: - workflow_run: - workflows: ["PR"] + pull_request: types: [edited] jobs: From e149b88add9f0a4818eb7538341fe264f478494a Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:06:38 +0000 Subject: [PATCH 08/39] vamos la --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 68c85c4..649bd25 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -1,7 +1,7 @@ name: Build LaTeX document on: pull_request: - types: [edited] + types: [edited, synchronize] jobs: build_latex: From df033271e7f4d2adab7f455b468ceded4db51e5e Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:09:34 +0000 Subject: [PATCH 09/39] vamo las --- .github/workflows/latex_build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 649bd25..5b0c2bd 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -1,6 +1,7 @@ name: Build LaTeX document on: - pull_request: + workflow_run: + workflows: ["PR"] types: [edited, synchronize] jobs: From 69ca8846b0119aa84f5bbd44d0ed296ed5fdbab9 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:15:54 +0000 Subject: [PATCH 10/39] vamos la --- .github/workflows/latex_build.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 5b0c2bd..71c55b7 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -1,8 +1,5 @@ name: Build LaTeX document -on: - workflow_run: - workflows: ["PR"] - types: [edited, synchronize] +on: pull_request jobs: build_latex: @@ -31,11 +28,12 @@ jobs: runs-on: windows-2019 steps: - name: comment PR - uses: tonyhallett/artifacts-url-comments@v1.1.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: actions/github-script@v6 with: - prefix: Segue o pdf - suffix: Valeo - format: name - addTo: pullandissues \ No newline at end of file + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for reporting!' + }) \ No newline at end of file From 81d7c251896054f47054138f56750649e4d24a2e Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:18:51 +0000 Subject: [PATCH 11/39] update --- .github/workflows/latex_build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 71c55b7..2b284b6 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -22,11 +22,6 @@ jobs: uses: actions/download-artifact@v3 with: name: main - - artifacts-url-comments: - name: add artifact links to pull request and related issues job - runs-on: windows-2019 - steps: - name: comment PR uses: actions/github-script@v6 with: From 5b6bfe0986bcccd8632ef9197056fafdeba9ac54 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:20:17 +0000 Subject: [PATCH 12/39] =?UTF-8?q?adicionando=20o=20artifact=20nos=20coment?= =?UTF-8?q?=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/latex_build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 2b284b6..8f7e869 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -26,9 +26,10 @@ jobs: uses: actions/github-script@v6 with: script: | + const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts/main`; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: '👋 Thanks for reporting!' + body: `👋 Thanks for reporting! Here is your [artifact](${artifactUrl})` }) \ No newline at end of file From 969d71cffd364dd414ea6917f572b7649ea7f7b1 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:30:22 +0000 Subject: [PATCH 13/39] colocando o id do artifact --- .github/workflows/latex_build.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 8f7e869..d8549de 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -22,14 +22,27 @@ jobs: uses: actions/download-artifact@v3 with: name: main + - name: Get artifact ID + id: get-artifact-id + uses: actions/github-script@v6 + with: + script: | + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: process.env.GITHUB_RUN_ID + }); + const artifact = artifacts.data.artifacts.find(a => a.name === 'main'); + return artifact.id; - name: comment PR uses: actions/github-script@v6 with: script: | - const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts/main`; + const artifactId = steps['get-artifact-id'].outputs.result; + const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts/${artifactId}`; github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `👋 Thanks for reporting! Here is your [artifact](${artifactUrl})` + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `👋 Thanks for reporting! Here is your [artifact](${artifactUrl})` }) \ No newline at end of file From 222e211e470ebaa70aef02f40b2c462cb03e103c Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:40:28 +0000 Subject: [PATCH 14/39] sera? --- .github/workflows/latex_build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index d8549de..48b820d 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -32,8 +32,10 @@ jobs: repo: context.repo.repo, run_id: process.env.GITHUB_RUN_ID }); - const artifact = artifacts.data.artifacts.find(a => a.name === 'main'); - return artifact.id; + if (artifacts.data.artifacts.length === 0) { + throw new Error('No artifacts found'); + } + return artifacts.data.artifacts[0].id; - name: comment PR uses: actions/github-script@v6 with: From 7db06d48456e6cbd24b1169125801a1061f48fb6 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:45:02 +0000 Subject: [PATCH 15/39] PERAI --- .github/workflows/latex_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 48b820d..097abd3 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -32,6 +32,7 @@ jobs: repo: context.repo.repo, run_id: process.env.GITHUB_RUN_ID }); + console.log(artifacts); if (artifacts.data.artifacts.length === 0) { throw new Error('No artifacts found'); } From ae0fd19db7e0970b5ea6b9bc42fb68de1e77344e Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:50:51 +0000 Subject: [PATCH 16/39] tentar de novo --- .github/workflows/latex_build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 097abd3..db0de25 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -18,10 +18,6 @@ jobs: with: name: main path: article/main.pdf - - name: download artifact - uses: actions/download-artifact@v3 - with: - name: main - name: Get artifact ID id: get-artifact-id uses: actions/github-script@v6 From 55ef3eeb0d383a890e01ff88b280b676e7101fab Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 00:56:44 +0000 Subject: [PATCH 17/39] bora ver --- .github/workflows/latex_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index db0de25..a336c31 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -26,9 +26,9 @@ jobs: const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: process.env.GITHUB_RUN_ID + run_id: context.payload.workflow_run.id }); - console.log(artifacts); + console.log(artifacts.data); if (artifacts.data.artifacts.length === 0) { throw new Error('No artifacts found'); } From 0449be15c15ab64f188b4ec527c7e3c982247b82 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:05:08 +0000 Subject: [PATCH 18/39] puts --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index a336c31..ae9030c 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -26,7 +26,7 @@ jobs: const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: context.payload.workflow_run.id + run_id: process.env.GITHUB_RUN_ID }); console.log(artifacts.data); if (artifacts.data.artifacts.length === 0) { From 846b6608a7657a39dd78621d027eb41ac4f40e01 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:20:10 +0000 Subject: [PATCH 19/39] opa --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index ae9030c..23ef0b8 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -26,7 +26,7 @@ jobs: const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: process.env.GITHUB_RUN_ID + run_id: github.event.workflow_run.id }); console.log(artifacts.data); if (artifacts.data.artifacts.length === 0) { From b077aaf27d58ec889ca5fad74cf230ead4d743a1 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:22:46 +0000 Subject: [PATCH 20/39] testar esse tambem --- .github/workflows/latex_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 23ef0b8..6a9a058 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -23,10 +23,10 @@ jobs: uses: actions/github-script@v6 with: script: | - const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: github.event.workflow_run.id + run_id: ${{github.event.workflow_run.id }}, }); console.log(artifacts.data); if (artifacts.data.artifacts.length === 0) { From f86f8ba2ddcd44d723c8e9a35af5038abe8875e5 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:26:36 +0000 Subject: [PATCH 21/39] ah mano --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 6a9a058..218ca70 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -26,7 +26,7 @@ jobs: var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, + run_id: ${{github.event.workflow_run.id }} }); console.log(artifacts.data); if (artifacts.data.artifacts.length === 0) { From f8169ff93e920d3241fd9722f8838653b3ff8858 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:32:51 +0000 Subject: [PATCH 22/39] esse commit [e pra salvar --- .github/workflows/latex_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 218ca70..ae9030c 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -23,10 +23,10 @@ jobs: uses: actions/github-script@v6 with: script: | - var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ + const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }} + run_id: process.env.GITHUB_RUN_ID }); console.log(artifacts.data); if (artifacts.data.artifacts.length === 0) { From e71126a6588882e267a4b7ce676ce4c1b3847984 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:34:52 +0000 Subject: [PATCH 23/39] ggfj --- .github/workflows/latex_build.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index ae9030c..9af6f0b 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -18,27 +18,12 @@ jobs: with: name: main path: article/main.pdf - - name: Get artifact ID - id: get-artifact-id - uses: actions/github-script@v6 - with: - script: | - const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: process.env.GITHUB_RUN_ID - }); - console.log(artifacts.data); - if (artifacts.data.artifacts.length === 0) { - throw new Error('No artifacts found'); - } - return artifacts.data.artifacts[0].id; - name: comment PR uses: actions/github-script@v6 with: script: | const artifactId = steps['get-artifact-id'].outputs.result; - const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts/${artifactId}`; + const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, From 3137af9aae6b0172819943fd81796c4268fa8521 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:38:06 +0000 Subject: [PATCH 24/39] pre final --- .github/workflows/latex_build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 9af6f0b..99bdb6a 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -22,11 +22,10 @@ jobs: uses: actions/github-script@v6 with: script: | - const artifactId = steps['get-artifact-id'].outputs.result; const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `👋 Thanks for reporting! Here is your [artifact](${artifactUrl})` + body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})` }) \ No newline at end of file From fef1d7b3812ff6adf89e1b66373209e18c979684 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:41:14 +0000 Subject: [PATCH 25/39] huum --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 99bdb6a..6c6ae7f 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -27,5 +27,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})` + body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})\n|Commit|Data de lançamento|\n\n|---|---|\n|${context.sha}|${new Date().toISOString()}|` }) \ No newline at end of file From 4baa598ff5fa94c820fc330a515d83645da47da8 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:44:48 +0000 Subject: [PATCH 26/39] vamos ver --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 6c6ae7f..9583152 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -27,5 +27,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})\n|Commit|Data de lançamento|\n\n|---|---|\n|${context.sha}|${new Date().toISOString()}|` + body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})\n|Commit|Data de lançamento|\n|---|---|\n|${context.payload.head_commit.message}|${new Date().toISOString()}|` }) \ No newline at end of file From 6ca3c9d6bc64eed1b6b83310c56e484d43680690 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:52:26 +0000 Subject: [PATCH 27/39] canseide --- .github/workflows/latex_build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 9583152..e46d861 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -23,9 +23,19 @@ jobs: with: script: | const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; + const commitMessage = context.payload.head_commit.message.split('\n')[0]; + const formatDate = (date) => { + const day = String(date.getDate()).padStart(2, '0'); + const month = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! + const year = date.getFullYear(); + + return day + '/' + month + '/' + year; + } + + const currentDate = formatDate(new Date()); github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})\n|Commit|Data de lançamento|\n|---|---|\n|${context.payload.head_commit.message}|${new Date().toISOString()}|` + body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})\n|Commit|Data de lançamento|\n|---|---|\n|${commitMessage}|${currentDate}|` }) \ No newline at end of file From 329ba87a59edf1f4e2f987aae8ad7ff4ae76e67e Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:55:41 +0000 Subject: [PATCH 28/39] perai --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index e46d861..025dbfb 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -23,7 +23,7 @@ jobs: with: script: | const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; - const commitMessage = context.payload.head_commit.message.split('\n')[0]; + const commitMessage = context.payload.head_commit; const formatDate = (date) => { const day = String(date.getDate()).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! From a9756cb3fad39d2a38d18759913da9b8213c0e41 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 01:56:59 +0000 Subject: [PATCH 29/39] seraaaaa --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 025dbfb..7ea0d44 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -23,7 +23,7 @@ jobs: with: script: | const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; - const commitMessage = context.payload.head_commit; + const commitMessage = github.event.head_commit.message; const formatDate = (date) => { const day = String(date.getDate()).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! From 05da9f097674d90132c046999a73fbf135a117e1 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:03:01 +0000 Subject: [PATCH 30/39] veremos --- .github/workflows/latex_build.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 7ea0d44..d893f55 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -25,11 +25,13 @@ jobs: const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; const commitMessage = github.event.head_commit.message; const formatDate = (date) => { - const day = String(date.getDate()).padStart(2, '0'); - const month = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! - const year = date.getFullYear(); + const day = String(date.getDate()).padStart(2, '0'); + const month = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! + const year = date.getFullYear(); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); - return day + '/' + month + '/' + year; + return day + '/' + month + '/' + year + ' ' + hours + ':' + minutes; } const currentDate = formatDate(new Date()); @@ -37,5 +39,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl})\n|Commit|Data de lançamento|\n|---|---|\n|${commitMessage}|${currentDate}|` + body: `👋 Aqui está uma nova versão do artigo em PDF: [link](${artifactUrl}). Lançado em ${currentDate}.` }) \ No newline at end of file From c43ba44d61de92eeee3c993e84e49af261d9b99f Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:06:30 +0000 Subject: [PATCH 31/39] final --- .github/workflows/latex_build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index d893f55..a4208cc 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -23,7 +23,6 @@ jobs: with: script: | const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; - const commitMessage = github.event.head_commit.message; const formatDate = (date) => { const day = String(date.getDate()).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! From 1e6365a4b6f0ba0451fc70fc123d02eba23b814f Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:13:50 +0000 Subject: [PATCH 32/39] uuuuuu --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index a4208cc..1a9b64b 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -33,7 +33,7 @@ jobs: return day + '/' + month + '/' + year + ' ' + hours + ':' + minutes; } - const currentDate = formatDate(new Date()); + const currentDate = formatDate(new Date().toLocaleString("pt-BR", {timeZone: "America/Sao_Paulo"})); github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, From 0a8b5121db44db17a5ccf21c65a23104ab359362 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:17:05 +0000 Subject: [PATCH 33/39] aaaaaa --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 1a9b64b..b415cb6 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -33,7 +33,7 @@ jobs: return day + '/' + month + '/' + year + ' ' + hours + ':' + minutes; } - const currentDate = formatDate(new Date().toLocaleString("pt-BR", {timeZone: "America/Sao_Paulo"})); + const currentDate = new Date().toLocaleString("pt-BR", {timeZone: "America/Sao_Paulo"}); github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, From 4a197d903ac96df4893559e9722d6fe7542d627e Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:23:52 +0000 Subject: [PATCH 34/39] =?UTF-8?q?removendo=20partes=20desnecess=C3=A1rias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/latex_build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index b415cb6..b688e69 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -23,16 +23,6 @@ jobs: with: script: | const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; - const formatDate = (date) => { - const day = String(date.getDate()).padStart(2, '0'); - const month = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! - const year = date.getFullYear(); - const hours = String(date.getHours()).padStart(2, '0'); - const minutes = String(date.getMinutes()).padStart(2, '0'); - - return day + '/' + month + '/' + year + ' ' + hours + ':' + minutes; - } - const currentDate = new Date().toLocaleString("pt-BR", {timeZone: "America/Sao_Paulo"}); github.rest.issues.createComment({ issue_number: context.issue.number, From de06c6b6962f292f4b4454f3e4759ca759c475bb Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:27:03 +0000 Subject: [PATCH 35/39] ssss --- .github/workflows/latex_build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index b688e69..e1e59e5 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -18,6 +18,12 @@ jobs: with: name: main path: article/main.pdf + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: my-artifact + - name: Display structure of downloaded files + run: ls -R - name: comment PR uses: actions/github-script@v6 with: From 706a3dffb9ea16bfb36b4d0598ede350899ee9db Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:30:04 +0000 Subject: [PATCH 36/39] main --- .github/workflows/latex_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index e1e59e5..e1da479 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -21,7 +21,7 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 with: - name: my-artifact + name: main - name: Display structure of downloaded files run: ls -R - name: comment PR From 4cb8c7d7f6056893d86fd38037e9798cb49b8413 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:33:47 +0000 Subject: [PATCH 37/39] chabarau --- .github/workflows/latex_build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index e1da479..78cfc95 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -18,10 +18,6 @@ jobs: with: name: main path: article/main.pdf - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: main - name: Display structure of downloaded files run: ls -R - name: comment PR From 2cfae5f067c1124105337f69e19180358f6539c1 Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:34:45 +0000 Subject: [PATCH 38/39] nao to muito crente mas bora ver --- .github/workflows/latex_build.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 78cfc95..163b88e 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -24,7 +24,23 @@ jobs: uses: actions/github-script@v6 with: script: | - const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; + const axios = require('axios'); + const jq = require('jq-web'); + + const getArtifactUrl = async () => { + const response = await axios.get(`https://api.github.com/repos/${context.repo.owner}/${context.repo.repo}/actions/artifacts?per_page=100`, { + headers: { + 'Authorization': `token ${process.env.GITHUB_TOKEN}`, + 'Accept': 'application/vnd.github.v3+json' + } + }); + + const artifacts = jq.json(response.data, '[.artifacts[] | {name : .name, archive_download_url : .archive_download_url}]'); + const artifact = artifacts.find(artifact => artifact.name === 'main'); + return artifact ? artifact.archive_download_url : ''; + } + + const artifactUrl = await getArtifactUrl(); const currentDate = new Date().toLocaleString("pt-BR", {timeZone: "America/Sao_Paulo"}); github.rest.issues.createComment({ issue_number: context.issue.number, From 45ff009e1609b1980a7b29db7f4795a602e576ab Mon Sep 17 00:00:00 2001 From: cancio Date: Wed, 20 Mar 2024 02:38:45 +0000 Subject: [PATCH 39/39] deixa pra la --- .github/workflows/latex_build.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/latex_build.yml b/.github/workflows/latex_build.yml index 163b88e..78cfc95 100644 --- a/.github/workflows/latex_build.yml +++ b/.github/workflows/latex_build.yml @@ -24,23 +24,7 @@ jobs: uses: actions/github-script@v6 with: script: | - const axios = require('axios'); - const jq = require('jq-web'); - - const getArtifactUrl = async () => { - const response = await axios.get(`https://api.github.com/repos/${context.repo.owner}/${context.repo.repo}/actions/artifacts?per_page=100`, { - headers: { - 'Authorization': `token ${process.env.GITHUB_TOKEN}`, - 'Accept': 'application/vnd.github.v3+json' - } - }); - - const artifacts = jq.json(response.data, '[.artifacts[] | {name : .name, archive_download_url : .archive_download_url}]'); - const artifact = artifacts.find(artifact => artifact.name === 'main'); - return artifact ? artifact.archive_download_url : ''; - } - - const artifactUrl = await getArtifactUrl(); + const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}`; const currentDate = new Date().toLocaleString("pt-BR", {timeZone: "America/Sao_Paulo"}); github.rest.issues.createComment({ issue_number: context.issue.number,