[前][次][番号順一覧][スレッド一覧]

ruby-changes:59193

From: Kazuhiro <ko1@a...>
Date: Wed, 11 Dec 2019 22:21:35 +0900 (JST)
Subject: [ruby-changes:59193] 7fa821a80d (master): Try to use `set-output`

https://git.ruby-lang.org/ruby.git/commit/?id=7fa821a80d

From 7fa821a80d60992f019c98ac813e2fc6e9775031 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Wed, 11 Dec 2019 14:01:23 +0900
Subject: Try to use `set-output`

because commit info are not necessary in env.

diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml
index 60c931e..0821d63 100644
--- a/.github/workflows/cygwin.yml
+++ b/.github/workflows/cygwin.yml
@@ -54,10 +54,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/cygwin.yml#L54
           git -C src reset --hard ${{ github.event.pull_request.head.sha }}
         if: github.event_name == 'pull_request'
         shell: cmd
-      - name: Actions-commit-info.sh
-        run: |
-          bash ./src/tool/actions-commit-info.sh
-        shell: cmd
+      - run: ./src/tool/actions-commit-info.sh
+        shell: bash
+        id: commit_info
       - name: Autoconf
         run: |
           cd src
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index ab73c19..724081d 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -35,6 +35,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L35
           GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
+        id: commit_info
       - name: Install libraries
         run: |
           export WAITS='5 60'
@@ -69,7 +70,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L70
           payload: |
             {
               "attachments": [{
-                "text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
+                "text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
                         "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
                         "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
                 "color": "danger"
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
index 73b242b..067140e 100644
--- a/.github/workflows/mjit.yml
+++ b/.github/workflows/mjit.yml
@@ -36,6 +36,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L36
           GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
+        id: commit_info
       - name: Fixed world writable dirs
         run: |
           chmod go-w $HOME
@@ -67,7 +68,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L68
           payload: |
             {
               "attachments": [{
-                "text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.jit_opts }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
+                "text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.jit_opts }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
                         "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
                         "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
                 "color": "danger"
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index b8f08dc..91c9e2b 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -68,6 +68,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L68
           GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
+        id: commit_info
       - name: Fixed world writable dirs
         run: |
           chmod go-w $HOME
@@ -103,7 +104,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L104
           payload: |
             {
               "attachments": [{
-                "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
+                "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
                         "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
                         "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
                 "color": "danger"
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index e1f5f8f..09e5887 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -50,6 +50,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L50
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
         shell: bash
+        id: commit_info
       - name: Configure
         run: |
           md build
@@ -78,7 +79,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L79
           payload: |
             {
               "attachments": [{
-                "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ env.COMMIT_DATE }} #${{ env.COMMIT_NUMBER_OF_DAY }}> " +
+                "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
                         "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
                         "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
                 "color": "danger"
diff --git a/tool/actions-commit-info.sh b/tool/actions-commit-info.sh
index c44f7d4..56f857c 100755
--- a/tool/actions-commit-info.sh
+++ b/tool/actions-commit-info.sh
@@ -1,17 +1,17 @@ https://github.com/ruby/ruby/blob/trunk/tool/actions-commit-info.sh#L1
 #!/bin/bash
 set -euo pipefail
 cd $(dirname "$0")/..
-set_env () {
+set_output () {
     echo "$1=$2"
-    echo "::set-env name=$1::$2"
+    echo "::set-output name=$1::$2"
 }
 COMMIT_TIMESTAMP="$(git log -1 --format=%ct)"
-set_env "COMMIT_TIMESTAMP" "$COMMIT_TIMESTAMP"
+set_output "COMMIT_TIMESTAMP" "$COMMIT_TIMESTAMP"
 LOGS=$(TZ=UTC git log --since='0:00' --date=iso-local --format='%cd %s')
 echo "commits of today:"
 echo "$LOGS"
 COUNT=$(echo "$LOGS" | wc -l)
 # strip spaces
 COUNT=$((0 + COUNT))
-set_env "COMMIT_NUMBER_OF_DAY" "$COUNT"
-set_env "COMMIT_DATE" "$(TZ=UTC git log --since='0:00' --date=short-local --format=%cd -1)"
+set_output "COMMIT_NUMBER_OF_DAY" "$COUNT"
+set_output "COMMIT_DATE" "$(TZ=UTC git log --since='0:00' --date=short-local --format=%cd -1)"
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]