Skip to main content
deleted 1 character in body
Source Link
Alexander Higgins
  • 6.9k
  • 1
  • 30
  • 45

Goal:

In GitHub Actions, to define my commit message dynamically from shell:

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on $(date -I)"

However, it seems that I have to define a environment variable then use it. I'm following How do I set an env var with a bash expression in GitHub Actions? and other help files like this, but still cannot tell how to make use of such environment variable that I've define previously. This is what I tried but failed:

      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          touch sample.js
          echo "today=$(date -I)" >> $GITHUB_ENV

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on ${today}"

How to make it workswork?

Goal:

In GitHub Actions, to define my commit message dynamically from shell:

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on $(date -I)"

However, it seems that I have to define a environment variable then use it. I'm following How do I set an env var with a bash expression in GitHub Actions? and other help files like this, but still cannot tell how to make use of such environment variable that I've define previously. This is what I tried but failed:

      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          touch sample.js
          echo "today=$(date -I)" >> $GITHUB_ENV

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on ${today}"

How to make it works?

Goal:

In GitHub Actions, to define my commit message dynamically from shell:

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on $(date -I)"

However, it seems that I have to define a environment variable then use it. I'm following How do I set an env var with a bash expression in GitHub Actions? and other help files like this, but still cannot tell how to make use of such environment variable that I've define previously. This is what I tried but failed:

      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          touch sample.js
          echo "today=$(date -I)" >> $GITHUB_ENV

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on ${today}"

How to make it work?

added 108 characters in body
Source Link
xpt
  • 23.6k
  • 47
  • 159
  • 250

Goal:

In GitHub Actions, to define my commit message dynamically from shell:

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on $(date -I)"

However, it seems that I have to define a environment variable then use it. I'm following How do I set an env var with a bash expression in GitHub Actions? and other help files like this, but still cannot tell how to make use of such environment variable that I've define previously. This is what I tried but failed:

      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          touch sample.js
          echo "today=$(date -I)" >> $GITHUB_ENV

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on ${today}"

How to make it works?

Goal:

In GitHub Actions, to define my commit message dynamically from shell:

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on $(date -I)"

However, it seems that I have to define a environment variable then use it. I'm following How do I set an env var with a bash expression in GitHub Actions? and other help files, but still cannot tell how to make use of such environment variable that I've define previously. This is what I tried but failed:

      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          touch sample.js
          echo "today=$(date -I)" >> $GITHUB_ENV

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on ${today}"

How to make it works?

Goal:

In GitHub Actions, to define my commit message dynamically from shell:

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on $(date -I)"

However, it seems that I have to define a environment variable then use it. I'm following How do I set an env var with a bash expression in GitHub Actions? and other help files like this, but still cannot tell how to make use of such environment variable that I've define previously. This is what I tried but failed:

      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          touch sample.js
          echo "today=$(date -I)" >> $GITHUB_ENV

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on ${today}"

How to make it works?

Source Link
xpt
  • 23.6k
  • 47
  • 159
  • 250

GitHub Actions to use variables set from shell

Goal:

In GitHub Actions, to define my commit message dynamically from shell:

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on $(date -I)"

However, it seems that I have to define a environment variable then use it. I'm following How do I set an env var with a bash expression in GitHub Actions? and other help files, but still cannot tell how to make use of such environment variable that I've define previously. This is what I tried but failed:

      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          touch sample.js
          echo "today=$(date -I)" >> $GITHUB_ENV

      - name: Commit changes
        uses: EndBug/add-and-commit@v7
        with:
          message: "added on ${today}"

How to make it works?