Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#9 rename to github #16

Merged
merged 3 commits into from
Dec 11, 2024
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
4 changes: 1 addition & 3 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"line-length": false
}
{ "line-length": false }
1 change: 1 addition & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
extends: default

rules:
braces: { min-spaces-inside: 0, max-spaces-inside: 2 }
comments-indentation: disable
line-length:
level: warning
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker-build-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
- name: build docker image
uses: senzing-factory/github-action-docker-buildx-build@v1
with:
build-options: "--build-arg \"GITHUB_HEAD_REF=${GITHUB_HEAD_REF:-${GITHUB_REF##*/}}\" \
build-options:
"--build-arg \"GITHUB_HEAD_REF=${GITHUB_HEAD_REF:-${GITHUB_REF##*/}}\" \
--build-arg \"GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME}\" "
context: build/docker
image-repository: senzing-factory/${{ steps.repo-basename.outputs.repo }}
Expand Down
2 changes: 1 addition & 1 deletion .project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>git-action-slack-notification</name>
<name>github-action-slack-notification</name>
</projectDescription>
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand All @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@senzing.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at `support@senzing.com`. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
60 changes: 35 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@

Welcome to the project!

We encourage contribution in a manner consistent with the [Code of Conduct](CODE_OF_CONDUCT.md).
We encourage contribution in a manner consistent with the [Code of Conduct].
The following will guide you through the process.

There are a number of ways you can contribute:

1. [Asking questions](#questions)
1. [Requesting features](#feature-requests)
1. [Reporting bugs](#bug-reporting)
1. [Contributing code or documentation](#contributing-code-or-documentation)
1. [Asking questions]
1. [Requesting features]
1. [Reporting bugs]
1. [Contributing code or documentation]

## License Agreements

If your contribution modifies the git repository, the following agreements must be established.
If your contribution modifies the Git repository, the following agreements must be established.

*Note:* License agreements are only needed for adding, modifying, and deleting artifacts kept within the repository.
_Note:_ License agreements are only needed for adding, modifying, and deleting artifacts kept within the repository.
In simple terms, license agreements are needed before pull requests can be accepted.
A license agreement is not needed for submitting feature request, bug reporting, or other project management.

### Individual Contributor License Agreement

In order to contribute to this repository, an
[Individual Contributor License Agreement (ICLA)](.github/senzing-individual-contributor-license-agreement.pdf)
[Individual Contributor License Agreement (ICLA)]
must be completed, submitted and accepted.

### Corporate Contributor License Agreement

If the contribution to this repository is on behalf of a company, a
[Corporate Contributor License Agreement (CCLA)](.github/senzing-corporate-contributor-license-agreement.pdf)
[Corporate Contributor License Agreement (CCLA)]
must also be completed, submitted and accepted.

### Project License Agreement

The license agreement for this repository is stated in the
[LICENSE](LICENSE) file.
[LICENSE] file.

## Questions

Expand All @@ -50,7 +50,7 @@ TODO: Instead, use ???

All feature requests are "GitHub issues".
To request a feature, create a
[GitHub issue](https://help.github.com/articles/creating-an-issue/)
[GitHub issue]
in this repository.

When creating an issue, there will be a choice to create a "Bug report" or a "Feature request".
Expand All @@ -59,20 +59,17 @@ Choose "Feature request".
## Bug Reporting

All bug reports are "GitHub issues".
Before reporting on a bug, check to see if it has
[already been reported](https://github.com/search?q=+is%3Aissue+user%3Asenzing).
To report a bug, create a
[GitHub issue](https://help.github.com/articles/creating-an-issue/)
in this repository.
Before reporting on a bug, check to see if it has [already been reported].
To report a bug, create a [GitHub issue] in this repository.

When creating an issue, there will be a choice to create a "Bug report" or a "Feature request".
Choose "Bug report".

## Contributing code or documentation

To contribute code or documentation to the repository, you must have
[License Agreements](#license-agreements) in place.
This needs to be complete before a [Pull Request](#pull-requests) can be accepted.
[License Agreements] in place.
This needs to be complete before a [Pull Request] can be accepted.

### Setting up a development environment

Expand All @@ -82,8 +79,8 @@ These variables may be modified, but do not need to be modified.
The variables are used throughout the installation procedure.

```console
export GIT_ACCOUNT=senzing
export GIT_REPOSITORY=template-docker
export GIT_ACCOUNT=senzing-factory
export GIT_REPOSITORY=github-action-slack-notification
```

Synthesize environment variables.
Expand Down Expand Up @@ -115,10 +112,23 @@ TODO:

### Pull Requests

Code in the master branch is modified via GitHub pull request.
Follow GitHub's
[Creating a pull request from a branch](https://help.github.com/articles/creating-a-pull-request/)
or
[Creating a pull request from a fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) instructions.
Code in the main branch is modified via GitHub pull request.
Follow GitHub's [Creating a pull request from a branch] or
[Creating a pull request from a fork] instructions.

Accepting pull requests will be at the discretion of Senzing, Inc. and the repository owner(s).

[already been reported]: https://github.com/search?q=+is%3Aissue+user%3Asenzing
[Asking questions]: #questions
[Code of Conduct]: CODE_OF_CONDUCT.md
[Contributing code or documentation]: #contributing-code-or-documentation
[Corporate Contributor License Agreement (CCLA)]: .github/senzing-corporate-contributor-license-agreement.pdf
[Creating a pull request from a branch]: https://help.github.com/articles/creating-a-pull-request/
[Creating a pull request from a fork]: https://help.github.com/articles/creating-a-pull-request-from-a-fork/
[GitHub issue]: https://help.github.com/articles/creating-an-issue/
[Individual Contributor License Agreement (ICLA)]: .github/senzing-individual-contributor-license-agreement.pdf
[LICENSE]: LICENSE
[License Agreements]: #license-agreements
[Pull Request]: #pull-requests
[Reporting bugs]: #bug-reporting
[Requesting features]: #feature-requests
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GIT_VERSION := $(shell git describe --always --tags --long --dirty | sed -e 's/\
# Docker variables

DOCKER_IMAGE_TAG ?= $(GIT_REPOSITORY_NAME):$(GIT_VERSION)
DOCKER_IMAGE_NAME := senzing/git-action-slack-notification
DOCKER_IMAGE_NAME := senzing-factory/github-action-slack-notification

# -------------
# TASKS
Expand Down
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Git Action Slack Notification
# GitHub Action Slack Notification

Git Action to send messages to Slack. This action can be used to send message about the status of a Git Action workflow.

## Usage

This action can be used after any other action. Below is simple example on using it:

1\. Create a `.github/workflows/git-action-slack-notification.yml`
1\. Create a `.github/workflows/github-action-slack-notification.yml`

2\. Add the following properties to `git-action-slack-notification.yml` file
2\. Add the following properties to `github-action-slack-notification.yml` file

```yaml
on: push
name: Slack Notification Demo
jobs:
slackNotification:
name: Slack Notification Demo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
slackNotification:
name: Slack Notification Demo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Slack Notification Demo
uses: senzing/git-action-slack-notification@1.0.0
uses: senzing-factory/github-action-slack-notification@1.0.0
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: Slack Notification Demo
SLACK_MESSAGE: Demo'ing the Slack Notification
```

Go [here](deployment/git-actions/template_git_action_slack_notification.yml) for a template yml with all environment variables.
Go [here](deployment/github-actions/template_github_action_slack_notification.yml) for a template yml with all environment variables.

3\. Generate Slack WebHook [here](https://entelexeia.slack.com/apps/A0F7XDUAZ-incoming-webhooks?next_id=0)

Expand All @@ -37,25 +37,25 @@ Go [here](deployment/git-actions/template_git_action_slack_notification.yml) for

These are the environment variables that can be set to pass in additional information about the Git Action.

| Variable Name | Required | Description |
|--------------------|:--------:|-------------|
| GITHUB_ACTION | No | GitHub Action name variable passed from Git Actions |
| GITHUB_ACTOR | No | GitHub Actor variable passed from Git Actions |
| GITHUB_EVENT_NAME | No | GitHub Action event name variable passed from Git Actions |
| GITHUB_REF | No | GitHub reference variable passed from Git Actions |
| GITHUB_REPOSITORY | No | GitHub Repository variable passed from Git Actions |
| GITHUB_WORKFLOW | No | GitHub Action workflow varaible passed from Git Actions |
| SLACK_CHANNEL | No | The Slack channel to use instead of the default |
| SLACK_COLOR | No | Format color to use for the Slack message |
| SLACK_ICON | No | The Slack user icon to use instead of the default |
| SLACK_MESSAGE | Yes | The message payload to be sent to Slack|
| SLACK_TITLE | Yes | Title of the Slack message being sent. |
| SLACK_USERNAME | No | The Slack username to use instead of the default |
| SLACK_WEBHOOK | Yes | The Webhook URL generated by Slack to send messages too. |
| Variable Name | Required | Description |
| ----------------- | :------: | --------------------------------------------------------- |
| GITHUB_ACTION | No | GitHub Action name variable passed from Git Actions |
| GITHUB_ACTOR | No | GitHub Actor variable passed from Git Actions |
| GITHUB_EVENT_NAME | No | GitHub Action event name variable passed from Git Actions |
| GITHUB_REF | No | GitHub reference variable passed from Git Actions |
| GITHUB_REPOSITORY | No | GitHub Repository variable passed from Git Actions |
| GITHUB_WORKFLOW | No | GitHub Action workflow varaible passed from Git Actions |
| SLACK_CHANNEL | No | The Slack channel to use instead of the default |
| SLACK_COLOR | No | Format color to use for the Slack message |
| SLACK_ICON | No | The Slack user icon to use instead of the default |
| SLACK_MESSAGE | Yes | The message payload to be sent to Slack |
| SLACK_TITLE | Yes | Title of the Slack message being sent. |
| SLACK_USERNAME | No | The Slack username to use instead of the default |
| SLACK_WEBHOOK | Yes | The Webhook URL generated by Slack to send messages too. |

## Reference

* [Using environment variables](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables) lists the default environment variables set in Git Actions.
- [Using environment variables](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables) lists the default environment variables set in Git Actions.

## License

Expand Down
14 changes: 7 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'Git Action Slack Notification'
description: 'Slack notification sent by Git Actions'
author: 'Senzing'
name: "GitHub Action Slack Notification"
description: "Slack notification sent by GitHub Actions"
author: "Senzing"
branding:
icon: 'message-square'
color: 'purple'
icon: "message-square"
color: "purple"
runs:
using: 'docker'
image: 'docker://senzing/git-action-slack-notification:1.0.0'
using: "docker"
image: "docker://senzing-factory/github-action-slack-notification:1.0.0"
14 changes: 7 additions & 7 deletions build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ RUN apk update && \

WORKDIR /go/src

RUN git clone https://github.com/senzing/git-action-slack-notification.git
RUN git clone https://github.com/senzing-factory/github-action-slack-notification.git

# Checkout to target branch and if not master, then locally test
# merging master into branch.
WORKDIR /go/src/git-action-slack-notification
WORKDIR /go/src/github-action-slack-notification
RUN git checkout ${GITHUB_HEAD_REF}; \
if [[ "${GITHUB_HEAD_REF}" != "master" && ${GITHUB_EVENT_NAME} == "pull_request" ]]; then \
git merge master; \
Expand All @@ -35,15 +35,15 @@ FROM alpine:3.10

LABEL "com.github.actions.icon"="message-square"
LABEL "com.github.actions.color"="purple"
LABEL "com.github.actions.name"="Git Aciton Slack Notification"
LABEL "com.github.actions.name"="GitHub Aciton Slack Notification"
LABEL "com.github.actions.description"="Send notification to Slack"

COPY --from=BUILD /go/bin/git-action-slack-notification /usr/bin
COPY --from=BUILD /go/src/git-action-slack-notification/LICENSE /
COPY --from=BUILD /go/src/git-action-slack-notification/README.md /
COPY --from=BUILD /go/bin/github-action-slack-notification /usr/bin
COPY --from=BUILD /go/src/github-action-slack-notification/LICENSE /
COPY --from=BUILD /go/src/github-action-slack-notification/README.md /

HEALTHCHECK CMD git --version || exit 1

USER 1001

ENTRYPOINT ["git-action-slack-notification"]
ENTRYPOINT ["github-action-slack-notification"]
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
on: push
name: Git Action Slack Notification Demo
name: GitHub Action Slack Notification Demo
jobs:
slackNotification:
name: Slack Notification Demo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Slack Notification Demo
uses: senzing/git-action-slack-notification@1.0.0
uses: senzing-factory/github-action-slack-notification@1.0.0
env:
GITHUB_ACTION: ${GITHUB_ACTION}
GITHUB_ACTOR: ${GITHUB_ACTOR}
Expand All @@ -16,7 +16,7 @@ jobs:
GITHUB_REPOSITORY: ${GITHUB_REPOSITORY}
GITHUB_WORKFLOW: ${GITHUB_WORKFLOW}
SLACK_CHANNEL: demo-channel
SLACK_COLOR: '#efefef'
SLACK_COLOR: "#efefef"
SLACK_ICON: https://github.com/<Github User>.png?size=48
SLACK_MESSAGE: Demo'ing the Slack Notification
SLACK_TITLE: Slack Notification Demo
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/senzing/git-action-slack-notification
module github.com/senzing-factory/github-action-slack-notification

go 1.13

Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"

"github.com/pkg/errors"
"github.com/senzing/git-action-slack-notification/configuration"
"github.com/senzing-factory/github-action-slack-notification/configuration"
)

type Message struct {
Expand Down Expand Up @@ -56,7 +56,8 @@ func (message *Message) Send(webhook string) error {
}

if response.StatusCode >= 299 {
err = fmt.Errorf(fmt.Sprintf("Exception: %s", response.Status))
formatted := fmt.Sprintf("Exception: %s", response.Status)
err = fmt.Errorf("%s", formatted)
}
fmt.Println(response.Status)

Expand Down
Loading